function setup() { $APSC_Data = new APSC_Data(); $APSC_Manage = new APSC_Manage(); $APSC_Filter = new APSC_Filter(); $APSC_Data->init(); }
function get_postbox($args) { global $APSC; $APSC_Data = new APSC_Data(); $Default = array('use' => 0, 'posts_per_page' => 'default', 'posts_per_page_num' => false, 'orderby' => 'date', 'orderby_set' => false, 'order' => 'desc', 'ignore_words' => array()); $Settings = $Default; if ($args['archive'] != 'custom_taxonomy') { $Data = $APSC_Data->get_data($args['archive']); } else { $Data = $APSC_Data->get_custom_taxonomy_data($args['taxonomy_name']); } if (!empty($Data)) { $field = 'default'; if (!empty($args['per_setting'])) { $field = $args['term_id']; } if (!empty($Data[$field])) { foreach ($Data[$field] as $key => $val) { $Settings[$key] = $val; } } } $this->show_postbox($Settings, $args); }
function get_data($query) { $Data = array(); $APSC_Data = new APSC_Data(); if ($query->is_home()) { $GetData = $APSC_Data->get_data('home'); } elseif ($query->is_category()) { $CatData = $APSC_Data->get_data('cat'); $current_cat_id = $query->get_queried_object()->cat_ID; if (!empty($CatData[$current_cat_id]) && !empty($CatData[$current_cat_id]['use'])) { $GetData['default'] = $CatData[$current_cat_id]; } elseif (!empty($CatData['default'])) { $GetData['default'] = $CatData['default']; } else { $GetData = ''; } } elseif ($query->is_tag()) { $GetData = $APSC_Data->get_data('tag'); } elseif ($query->is_tax()) { $tax = $query->get_queried_object(); if (!empty($tax)) { $current_taxonomy = $query->get_queried_object()->taxonomy; $current_term_id = $query->get_queried_object()->term_id; $TaxData = $APSC_Data->get_custom_taxonomy_data($current_taxonomy); if (!empty($TaxData[$current_term_id]) && !empty($TaxData[$current_term_id]['use'])) { $GetData['default'] = $TaxData[$current_term_id]; } elseif (!empty($TaxData['default'])) { $GetData['default'] = $TaxData['default']; } else { $GetData = ''; } } } elseif ($query->is_search()) { $GetData = $APSC_Data->get_data('search'); } elseif ($query->is_archive() && $query->is_month()) { $GetData = $APSC_Data->get_data('monthly'); } if (!empty($GetData) && !empty($GetData['default'])) { $Data = $GetData['default']; } return $Data; }