예제 #1
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('post_types', __('Post Types', ContentAwareSidebars::DOMAIN), true);
     $this->type_display = true;
     $this->searchable = true;
     add_action('transition_post_status', array(&$this, 'post_ancestry_check'), 10, 3);
 }
 public function __construct($categories = null, $listings = null, $walker = null, $request = null)
 {
     parent::__construct(AWPCP_CAS_LISTINGS_CATEGORIES_MODULE, __('Categories (AWPCP)', 'AWPCP'));
     if (is_null($categories)) {
         $this->categories = awpcp_categories_collection();
     } else {
         $this->categories = $categories;
     }
     if (is_null($listings)) {
         $this->listings = awpcp_listings_collection();
     } else {
         $this->listings = $listings;
     }
     if (is_null($walker)) {
         $this->walker = awpcp_content_aware_sidebars_categories_walker($this->id);
     } else {
         $this->walker = $walker;
     }
     if (is_null($request)) {
         $this->request = awpcp_request();
     } else {
         $this->request = $request;
     }
 }
예제 #3
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('date', __('Dates', ContentAwareSidebars::DOMAIN), false);
 }
예제 #4
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('language', __('Languages', ContentAwareSidebars::DOMAIN));
     add_filter('pll_get_post_types', array(&$this, 'remove_sidebar_multilingual'));
 }
예제 #5
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('page_templates', __('Page Templates', ContentAwareSidebars::DOMAIN));
     $this->type_display = true;
 }
예제 #6
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('bp_member', __('BuddyPress Members', ContentAwareSidebars::DOMAIN));
     add_filter('cas-is-content-static', array(&$this, 'static_is_content'));
 }
예제 #7
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('authors', __('Authors', ContentAwareSidebars::DOMAIN), true);
     $this->searchable = true;
     $this->type_display = true;
 }
예제 #8
0
 /**
  * Save data on POST
  * @author  Joachim Jensen <*****@*****.**>
  * @param   int    $post_id
  * @return  void
  */
 public function save_data($post_id)
 {
     parent::save_data($post_id);
     $tax_input = isset($_POST['cas_condition']['tax_input']) ? $_POST['cas_condition']['tax_input'] : array();
     //Save terms
     //Loop through each public taxonomy
     foreach ($this->_get_taxonomies() as $taxonomy) {
         if (current_user_can($taxonomy->cap->assign_terms)) {
             //If no terms, maybe delete old ones
             if (!isset($tax_input[$taxonomy->name])) {
                 $terms = null;
             } else {
                 $terms = $tax_input[$taxonomy->name];
                 //Hierarchical taxonomies use ids instead of slugs
                 //see http://codex.wordpress.org/Function_Reference/wp_set_post_terms
                 if ($taxonomy->hierarchical) {
                     $terms = array_unique(array_map('intval', $terms));
                 }
             }
             wp_set_object_terms($post_id, $terms, $taxonomy->name);
         }
     }
 }
예제 #9
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('language', __('Languages', ContentAwareSidebars::DOMAIN));
 }
예제 #10
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct('static', __('Static Pages', ContentAwareSidebars::DOMAIN));
     $this->type_display = false;
 }