示例#1
0
 function hook_td_global_after()
 {
     //add the api code inside this function
     // Add a new module
     td_api_module::add('td_module_77', array('file' => $this->plugin_path . "/modules/td_module_77.php", 'text' => 'Module 77', 'img' => $this->plugin_url . '/images/modules/td_module_77.png', 'used_on_blocks' => array('td_block_77'), 'excerpt_title' => 12, 'excerpt_content' => 25, 'enabled_on_more_articles_box' => true, 'enabled_on_loops' => true, 'uses_columns' => true, 'category_label' => true, 'class' => 'td_module_wrap td-animation-stack'));
     // Add a new block
     td_api_block::add('td_block_77', array('map_in_visual_composer' => true, "name" => 'Block 77', "base" => 'td_block_77', "class" => 'td_block_77', "controls" => "full", "category" => 'Blocks', 'icon' => 'icon-pagebuilder-td_block_77', 'file' => $this->plugin_path . '/shortcodes/td_block_77.php', "params" => array_merge(td_wp_booster_config::get_map_block_general_array(), td_wp_booster_config::get_map_filter_array(), td_wp_booster_config::get_map_block_ajax_filter_array(), td_wp_booster_config::get_map_block_pagination_array())));
 }
 /**
  *  setting the array that will be used for homepage filter
  * @return array
  */
 function homepage_filter_get_map()
 {
     //get the generic filter array
     $generic_filter_array = td_wp_booster_config::get_map_filter_array();
     //remove items from array
     $offset = 0;
     foreach ($generic_filter_array as $field_array) {
         if ($field_array['param_name'] == "hide_title") {
             array_splice($generic_filter_array, $offset, 1);
         }
         $offset++;
     }
     //change the default limit
     $generic_filter_array[6]['value'] = 10;
     //add the show featured posts in the loop setting
     array_push($generic_filter_array, array("param_name" => "show_featured_posts", "type" => "dropdown", "value" => array('- Show featured posts -' => '', 'Hide featured posts' => 'hide_featured'), "heading" => 'Featured posts:', "description" => "", "holder" => "div", "class" => ""));
     return array("name" => 'Templates with articles', "base" => "", "class" => "", "controls" => "full", "category" => "", 'icon' => '', "params" => $generic_filter_array);
 }
示例#3
0
        $temp_array_merge = array_merge(array(array("param_name" => "autoplay", "type" => "textfield", "value" => '', "heading" => 'Autoplay slider (at x seconds)', "description" => "Leave empty do disable autoplay", "holder" => "div", "class" => "")), self::get_map_filter_array(), $map_block_array);
        return $temp_array_merge;
    }
    private static function td_block_big_grid_slide_params()
    {
        $params = array_merge(self::td_block_big_grid_params(), array(array("param_name" => "autoplay", "type" => "textfield", "value" => '', "heading" => 'Autoplay slider (at x seconds)', "description" => "Leave empty do disable autoplay", "holder" => "div", "class" => ""), array("param_name" => "limit", "type" => "textfield", "value" => 4, "heading" => __("Limit post number:", TD_THEME_NAME), "description" => "", "holder" => "div", "class" => "")));
        //		array_shift($params);
        //		array_unshift($params, array(
        //			"param_name" => "td_grid_style",
        //			"type" => "dropdown",
        //			"value" => array(
        //				'Grid style 4' => 'td-grid-style-4',
        //			),
        //			"heading" => "Available big grid style for this plugin:",
        //			"description" => "",
        //			"holder" => "div",
        //			"class" => ""
        //		));
        return $params;
    }
    /**
     * hook up, is called at EOF
     */
    static function hook()
    {
        add_action('td_global_after', array('td_wp_booster_config', 'td_global_after'), 9);
        //we run on 9 priority to allow plugins to updage_key our apis while using the default priority of 10
    }
}
td_wp_booster_config::hook();