Example #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);
 }