Example #1
0
 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'));
 }
Example #2
0
 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);
 }
Example #3
0
 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;
 }
Example #4
0
 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') );
 }
Example #5
0
function add_ccs_shortcode($tag, $func = null, $global = true)
{
    if (is_array($tag)) {
        if ($func === false) {
            $global = false;
        }
        foreach ($tag as $this_tag => $this_func) {
            if (!in_array($this_tag, CCS_Plugin::$state['disabled_shortcodes'])) {
                add_local_shortcode('ccs', $this_tag, $this_func, $global);
            }
        }
    } else {
        if (!in_array($tag, CCS_Plugin::$state['disabled_shortcodes'])) {
            add_local_shortcode('ccs', $tag, $func, $global);
        }
    }
}