Esempio n. 1
0
 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'));
 }
Esempio n. 2
0
 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
 }
Esempio n. 3
0
 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')));
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
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'));
 }
Esempio n. 6
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);
 }
Esempio n. 7
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;
 }
Esempio n. 8
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') );
 }
Esempio n. 9
0
 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'));
         }
     }
 }
Esempio n. 10
0
 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'));
         }
     }
 }
Esempio n. 11
0
 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'));
 }
 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);
         }
     }
 }
Esempio n. 13
0
 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'));
 }
Esempio n. 14
0
 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;
 }
 static function add($tag, $func = null, $global = true)
 {
     add_ccs_shortcode($tag, $func, $global);
 }
Esempio n. 16
0
 function __construct()
 {
     add_ccs_shortcode(array('format' => array($this, 'format_shortcode'), 'clean' => array($this, 'clean_shortcode'), 'br' => array($this, 'br_shortcode'), 'p' => array($this, 'p_shortcode'), 'link' => array($this, 'link_shortcode'), 'image' => array($this, 'image_shortcode'), 'slugify' => array($this, 'slugify_shortcode'), 'unslugify' => array($this, 'unslugify_shortcode'), 'today' => array($this, 'today_shortcode'), 'http' => array($this, 'http_shortcode'), 'embed' => array($this, 'embed_shortcode'), 'escape' => array($this, 'escape_shortcode'), 'random' => array($this, 'random_shortcode'), 'x' => array($this, 'x_shortcode')));
     add_shortcode('direct', array($this, 'direct_shortcode'));
     self::$state['x_loop'] = 0;
 }
Esempio n. 17
0
 * Bootstrap navwalker shortcode
 *
 */
function custom_bootstrap_navbar($atts, $content = null)
{
    extract(shortcode_atts(array('menu' => null, 'navclass' => null), $atts));
    $menu_args = array('menu' => $menu, 'echo' => false, 'depth' => 2, 'container' => false, 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'ccs_bootstrap_navwalker::fallback', 'walker' => new ccs_bootstrap_navwalker());
    if ($navclass == '') {
        $navclass = "top-nav";
    }
    $output = '<nav class="navbar navbar-default ' . $navclass . '" role="navigation">';
    // Brand and toggle get grouped for better mobile display -->
    $output .= '
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>';
    if ($content != '') {
        $output .= '<a class="navbar-brand" href="' . get_site_url() . '">' . do_shortcode($content) . '</a>';
    }
    $output .= '</div>

		<div class="collapse navbar-collapse navbar-ex1-collapse">';
    $output .= wp_nav_menu($menu_args) . '</div></nav>';
    return $output;
}
add_ccs_shortcode('navbar', 'custom_bootstrap_navbar');
Esempio n. 18
0
 function __construct()
 {
     add_ccs_shortcode('widget', array($this, 'do_widget_shortcode'));
 }
Esempio n. 19
0
 function __construct()
 {
     add_ccs_shortcode(array('users' => array($this, 'users_shortcode'), 'user' => array($this, 'user_shortcode'), 'is' => array($this, 'is_shortcode'), 'isnt' => array($this, 'is_shortcode'), 'get-blog' => array($this, 'blog_shortcode'), 'list_shortcodes' => array($this, 'list_shortcodes'), 'search_form' => array($this, 'search_form_shortcode')));
     self::$state['is_users_loop'] = false;
 }
Esempio n. 20
0
 function __construct()
 {
     $this->init();
     add_ccs_shortcode('related', array($this, 'loop_related_posts'));
 }
Esempio n. 21
0
 function __construct()
 {
     add_ccs_shortcode(array('loopage' => array($this, 'loopage_shortcode'), 'the-pagination' => array($this, 'loopage_shortcode'), 'loopage-now' => array($this, 'loopage_now_shortcode'), 'loopage-total' => array($this, 'loopage_total_shortcode'), 'loopage-prev' => array($this, 'loopage_prev_next_shortcode'), 'loopage-next' => array($this, 'loopage_prev_next_shortcode'), 'page-now' => array($this, 'page_now_shortcode'), 'page-total' => array($this, 'page_total_shortcode')));
 }
Esempio n. 22
0
 function __construct()
 {
     self::$math = new GoodMath();
     add_ccs_shortcode('calc', array($this, 'calc_shortcode'));
 }
Esempio n. 23
0
 function __construct()
 {
     add_ccs_shortcode(array('pass' => array($this, 'pass_shortcode'), '-pass' => array($this, 'pass_shortcode'), '--pass' => array($this, 'pass_shortcode')));
 }
Esempio n. 24
0
 function __construct()
 {
     add_filter('body_class', array($this, 'mobile_body_class'));
     self::$detect = new CCS_Mobile_Detect_Extended();
     self::$is_mobile = self::$detect->isMobile();
     self::$device_type = self::$is_mobile ? self::$detect->isTablet() ? 'tablet' : 'phone' : 'computer';
     self::$device = self::$detect->getDevice();
     self::$browser = self::$detect->getBrowser();
     // @todo Use [is] shortcode instead and deprecate these
     add_ccs_shortcode('is_mobile', array($this, 'is_mobile'));
     add_ccs_shortcode('is_phone', array($this, 'is_phone'));
     add_ccs_shortcode('isnt_phone', array($this, 'isnt_phone'));
     add_ccs_shortcode('is_tablet', array($this, 'is_tablet'));
     add_ccs_shortcode('is_computer', array($this, 'is_computer'));
     add_ccs_shortcode('isnt_computer', array($this, 'isnt_computer'));
 }