Пример #1
0
 /**
  * Retrieve a post permalink.
  *
  * @since  1.0.0
  * @global WP_Post $post WP_Post object.
  * @return string        Post permalink.
  */
 public function permalink()
 {
     global $post;
     $shortcode = Cherry_Shortcodes_Handler::get_shortcode_name();
     $permalink = esc_url(get_permalink($post->ID));
     if (empty($permalink)) {
         return;
     }
     /**
      * Filter a post permalink.
      *
      * @since 1.0.0
      * @param string $permalink Post permalink.
      * @param array  $atts      Shortcode attributes.
      * @param string $shortcode Shortcode name.
      */
     return apply_filters('cherry_shortcodes_permalink_template_callbacks', $permalink, $this->atts, $shortcode);
 }
 public function permalink()
 {
     global $post;
     $shortcode = Cherry_Shortcodes_Handler::get_shortcode_name();
     $permalink = esc_url(get_permalink($post->ID));
     if (empty($permalink)) {
         return;
     }
     return apply_filters('cherry_shortcodes_permalink_template_callbacks', $permalink, $this->atts, $shortcode);
 }