Esempio n. 1
0
 /**
  * __construct
  *
  * @param string $post_type
  * @param array $args
  */
 public function __construct($post_type = 'slide', $args = array())
 {
     $args = array('description' => __("Add sliders to the site carousel.", THEMENAME), 'exclude_from_search' => true, 'publicly_queryable' => false, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'show_in_admin_bar' => true, 'supports' => array('title', 'editor', 'thumbnail'), 'rewrite' => false, 'query_var' => false, 'can_export' => true);
     parent::__construct($post_type, $args);
     self::add_link_metabox();
     // register shortcode to render the slider carousel
     add_shortcode('slider', array('PressGang\\Slider', 'do_shortcode'));
 }
Esempio n. 2
0
 /**
  * __construct
  *
  * @param string $post_type
  * @param array $args
  */
 public function __construct($post_type = 'slide', $args = array())
 {
     $args = array('description' => __("Add sliders to the site carousel.", THEMENAME), 'exclude_from_search' => true, 'publicly_queryable' => false, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'show_in_admin_bar' => true, 'supports' => array('title', 'editor', 'thumbnail'), 'rewrite' => false, 'query_var' => false, 'can_export' => true);
     parent::__construct($post_type, $args);
     // register shortcode to render the slider carousel
     add_shortcode('slider', array('PressGang\\Slider', 'render'));
     // add scripts to loader queue
     Scripts::$scripts['focuspoint'] = array('src' => get_template_directory_uri() . '/js/vendor/focuspoint/jquery.focuspoint.js', 'deps' => array('jquery'), 'ver' => '1.0.3b', 'in_footer' => true);
     // load pressgang which inits the focus point
     Scripts::$scripts['pressgang'] = array('src' => get_template_directory_uri() . '/js/custom/pressgang.js', 'deps' => array('focuspoint'), 'ver' => '0.1', 'in_footer' => true);
     self::add_link_metabox();
     self::add_focus_point_metabox();
 }
Esempio n. 3
0
 public function __construct()
 {
     // Register Home Page fields for front_page and posts_page only
     $homepage_metabox = array('id' => 'custom_homepage_fields', 'title' => 'Home Page Fields', 'fields' => $this->get_fields(array(array('id' => 'homepage_message', 'name' => __('Home Page Message'), 'description' => 'The message that will appear below the header image', 'type' => 'textarea', 'formatting' => 'html'), array('id' => 'homepage_spotlight', 'name' => __('Home Page Spotlight'), 'description' => 'The spotlight that will appear to the right of the home page message', 'type' => 'post_object', 'post_type' => array('spotlight')))), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'page', 'order_no' => 0, 'group_no' => 0), array('param' => 'page_type', 'operator' => '==', 'value' => 'front_page', 'order_no' => 1, 'group_no' => 0)), array(array('param' => 'page_type', 'operator' => '==', 'value' => 'posts_page', 'order_no' => 0, 'group_no' => 1))), 'options' => array('position' => 'acf_after_title'));
     $this->metaboxes[] = $homepage_metabox;
     // Build default post type meta fields
     parent::__construct();
 }