wc_post_content_has_shortcode آیا در محتوای محصول شورت کد وجود دارد ؟

wc_post_content_has_shortcode آیا در محتوای محصول شورت کد وجود دارد ؟

تابع ووکامرسی wc_post_content_has_shortcode – بررسی اینکه آیا در محتوای محصول شورت کد وجود دارد ؟

Syntax – سینتکس

wc_post_content_has_shortcode( (string) $tag = '' ); 

Parameters – پارامتر ها (1)

  • 1- $tag (string)

Usage – نحوه استفاده

if ( !function_exists( 'wc_post_content_has_shortcode' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-conditional-functions.php'; 
} 
  
// Shortcode tag to check. 
$tag = ''; 
  
// NOTICE! Understand what this does before running. 
$result = wc_post_content_has_shortcode($tag); 
    

Defined – محل تعریف

/includes/wc-conditional-functions.php

function wc_post_content_has_shortcode( $tag = '' ) { 
    global $post; 
 
    return is_singular() && is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, $tag ); 
} 

versions – نسخه ها

از نسخه : 3.0.2

نسخه فعلی : 3.0.6

دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2

ارسال نظر

جهت استفاده از کد حتما از تگ pre استفاده نمایید .

contact us