本文整理汇总了PHP中add_ccs_shortcode函数的典型用法代码示例。如果您正苦于以下问题:PHP add_ccs_shortcode函数的具体用法?PHP add_ccs_shortcode怎么用?PHP add_ccs_shortcode使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_ccs_shortcode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
add_ccs_shortcode(array('load' => array($this, 'load'), 'css' => array($this, 'css_wrap'), 'js' => array($this, 'js_wrap')));
add_action('wp_head', array($this, 'load_css_field'));
add_action('the_content', array($this, 'load_html_field'));
add_action('wp_footer', array($this, 'load_js_field'));
}
示例2: __construct
function __construct()
{
add_ccs_shortcode(array('cache' => array($this, 'cache_shortcode'), 'timer' => array($this, 'timer_shortcode')));
self::$transient_prefix = 'ccs_';
self::$num_queries = get_num_queries();
// Number of queries at init
}
示例3: __construct
function __construct()
{
self::$index = 0;
self::$state['is_for_loop'] = false;
self::$state['for_count'] = 0;
add_ccs_shortcode(array('for' => array($this, 'for_shortcode'), 'each' => array($this, 'each_shortcode'), '-for' => array($this, 'for_shortcode'), '--for' => array($this, 'for_shortcode'), '-each' => array($this, 'each_shortcode'), '--each' => array($this, 'each_shortcode')));
}
示例4: __construct
function __construct()
{
add_ccs_shortcode(array('content' => array($this, 'content_shortcode'), 'field' => array($this, 'field_shortcode'), 'taxonomy' => array($this, 'taxonomy_shortcode'), 'array' => array($this, 'array_field_shortcode'), '-array' => array($this, 'array_field_shortcode'), '--array' => array($this, 'array_field_shortcode'), 'array-count' => array($this, 'array_count_shortcode'), 'raw' => array($this, 'do_raw')));
self::$state = array();
self::$state['depth'] = 0;
self::$state['current_ids'] = array();
self::$state['is_array_field'] = false;
}
示例5: __construct
function __construct()
{
self::$state['is_if_block'] = false;
self::$vars = array();
add_ccs_shortcode(array('if' => array($this, 'if_shortcode'), '-if' => array($this, 'if_shortcode'), '--if' => array($this, 'if_shortcode'), '---if' => array($this, 'if_shortcode'), '----if' => array($this, 'if_shortcode'), 'var' => array($this, 'var_shortcode'), 'switch' => array($this, 'switch_shortcode')));
add_local_shortcode('ccs_switch', 'when', array($this, 'when_shortcode'));
add_local_shortcode('ccs_switch', 'case', array($this, 'when_shortcode'));
}
示例6: register
function register()
{
add_ccs_shortcode(array('loop-menu' => array($this, 'loop_menu_shortcode')));
for ($i = 0; $i < 5; $i++) {
add_local_shortcode('ccs_menu', str_repeat('-', $i) . 'children', array($this, 'loop_menu_children'));
}
add_filter('ccs_loop_add_defaults', array($this, 'loop_menu_filter_parameters'));
add_filter('ccs_loop_before_query', array($this, 'loop_menu_filter'), $priority = 10, $accepted_args = 3);
}
示例7: __construct
function __construct()
{
add_ccs_shortcode(array('comments' => array($this, 'comments_shortcode'), '-comments' => array($this, 'comments_shortcode'), 'comment' => array($this, 'comment_shortcode'), '-comment' => array($this, 'comment_shortcode'), 'comment-form' => array($this, 'comment_form_shortcode')));
add_local_shortcode('comment-form', 'input', array($this, 'comment_form_input_shortcode'));
add_local_shortcode('comment-form', 'option', array($this, 'comment_form_input_shortcode'));
self::$state['inputs'] = array('author', 'email', 'url', 'comment', 'submit', 'cancel', 'reply', 'reply_to', 'login', 'logged-in', 'before', 'after');
self::$state['is_comments_loop'] = false;
self::$state['current_comment'] = '';
self::$state['comments_loop_index'] = 0;
self::$state['comments_loop_count'] = 0;
}
示例8: __construct
function __construct()
{
self::init();
add_ccs_shortcode(array('loop' => array($this, 'the_loop_shortcode'), '-loop' => array($this, 'the_loop_shortcode'), '--loop' => array($this, 'the_loop_shortcode'), 'prev-next' => array($this, 'prev_next_shortcode'), 'loop-count' => array($this, 'loop_count_shortcode'), 'found-posts' => array($this, 'found_posts_shortcode'), 'search-keyword' => array($this, 'search_keyword_shortcode'), 'the-loop' => array($this, 'default_loop_shortcode')));
add_local_shortcode('loop', 'prev', array($this, 'prev_shortcode'));
add_local_shortcode('loop', 'next', array($this, 'next_shortcode'));
// newer/older - default order DESC (new to old)
add_local_shortcode('loop', 'newer', array($this, 'prev_shortcode'));
add_local_shortcode('loop', 'older', array($this, 'next_shortcode'));
add_shortcode('note', array($this, 'shortcode_comment'));
//add_shortcode( '!', array($this, 'shortcode_comment') );
}
示例9: wck_exists
function wck_exists()
{
// Is the WCK plugin loaded?
if (function_exists('get_cfc_field') && function_exists('get_cfc_meta')) {
self::$state['is_wck_loaded'] = true;
add_ccs_shortcode(array('metabox' => array($this, 'wck_metabox_shortcode'), 'wck-field' => array($this, 'wck_field_shortcode'), 'post-field' => array($this, 'wck_field_shortcode'), 'wck-repeat' => array($this, 'wck_repeater_shortcode'), 'repeater' => array($this, 'general_repeater_shortcode')));
} else {
if (class_exists('CCS_To_ACF')) {
add_ccs_shortcode('repeater', array('CCS_To_ACF', 'loop_through_acf_field'));
}
}
}
示例10: __construct
function __construct()
{
$tags = array('a', 'aside', 'b', 'button', 'article', 'block', 'center', 'code', 'div', 'dl', 'dt', 'dd', 'em', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'i', 'input', 'label', 'li', 'ol', 'pre', 'section', 'select', 'option', 'span', 'table', 'tbody', 'td', 'th', 'thead', 'tr', 'textarea', 'u', 'ul');
foreach ($tags as $tag) {
add_ccs_shortcode($tag, array($this, 'block_shortcode'));
}
$nested = array('div', 'ol', 'li', 'ul', 'block');
foreach ($nested as $tag) {
for ($i = 1; $i < 6; $i++) {
$prefix = str_repeat('-', $i);
add_ccs_shortcode($prefix . $tag, array($this, 'block_shortcode'));
}
}
}
示例11: __construct
function __construct()
{
self::$state['is_relationship_loop'] = false;
self::$state['is_repeater_or_flex_loop'] = false;
self::$state['is_gallery_loop'] = false;
self::$state['repeater_index'] = 0;
// add_action( 'init', array($this, 'init') ); // Wait until plugins and theme loaded
// Available to themes
add_ccs_shortcode(array('acf_sub' => array($this, 'acf_sub_field'), 'flex' => array($this, 'loop_through_acf_field'), '-flex' => array($this, 'loop_through_acf_field'), '--flex' => array($this, 'loop_through_acf_field'), '-repeater' => array($this, 'loop_through_acf_field'), 'acf_gallery' => array($this, 'loop_through_acf_gallery_field'), 'acf_image' => array($this, 'get_image_details_from_acf_gallery'), 'layout' => array($this, 'if_get_row_layout'), '-layout' => array($this, 'if_get_row_layout'), '--layout' => array($this, 'if_get_row_layout')));
// This will be called by [repeater] if not inside WCK metabox
// add_local_shortcode( 'ccs', 'repeater', array($this, 'loop_through_acf_field'));
// add_local_shortcode( 'ccs', 'sub_image', array($this, 'get_image_details_from_acf_gallery')); // This will be called by [related] when relationship field is specified
// add_local_shortcode( 'ccs', 'related', array($this, 'loop_relationship_field'));
add_filter('ccs_loop_parameters', array($this, 'acf_date_parameters_for_loop'));
}
示例12: create_shortcodes
function create_shortcodes()
{
$posts = get_posts(array('post_type' => 'shortcode', 'posts_per_page' => -1));
foreach ($posts as $post) {
$name = $post->post_title;
// post_name
// Already exists
if (isset($this->shortcodes[$name])) {
continue;
}
$this->shortcodes[$name] = $post->post_content;
$callback = array($this, 'meta_shortcode');
if ($this->is_ccs) {
add_ccs_shortcode($name, $callback);
} else {
add_shortcode($name, $callback);
}
}
}
示例13: __construct
function __construct()
{
self::$urls = array();
add_ccs_shortcode(array('url' => array($this, 'url_shortcode'), 'redirect' => array($this, 'redirect_shortcode'), 'query' => array($this, 'query_shortcode'), 'route' => array($this, 'route_shortcode')));
add_action('wp_head', array($this, 'init'));
}
示例14: __construct
function __construct()
{
add_ccs_shortcode(array('attached' => array($this, 'attached_shortcode'), '-attached' => array($this, 'attached_shortcode'), 'attached-field' => array($this, 'attached_field_shortcode')));
self::$state['is_attachment_loop'] = false;
}
示例15: add
static function add($tag, $func = null, $global = true)
{
add_ccs_shortcode($tag, $func, $global);
}