public static function register_post_types()
 {
     if (post_type_exists(Follow_Up_Emails::$post_type)) {
         return;
     }
     register_post_type(Follow_Up_Emails::$post_type, array('labels' => array('name' => __('Follow-Up Emails', 'follow_up_emails'), 'singular_name' => __('Follow-Up Email', 'follow_up_emails'), 'menu_name' => _x('Follow-Up Emails', 'Admin menu name', 'follow_up_emails'), 'add_new' => __('Add Email', 'follow_up_emails'), 'add_new_item' => __('Add New Email', 'follow_up_emails'), 'edit' => __('Edit', 'follow_up_emails'), 'edit_item' => __('Edit Email', 'follow_up_emails'), 'new_item' => __('New Follow-Up Email', 'follow_up_emails'), 'view' => __('View Email', 'follow_up_emails'), 'view_item' => __('View Email', 'follow_up_emails'), 'search_items' => __('Search Follow-Up Emails', 'follow_up_emails'), 'not_found' => __('No Emails found', 'follow_up_emails'), 'not_found_in_trash' => __('No Emails found in trash', 'follow_up_emails')), 'public' => false, 'show_ui' => true, 'show_in_menu' => false, 'show_in_admin_bar' => true, 'hierarchical' => false, 'supports' => array('title', 'editor')));
 }
Example #2
0
 public function register_post_types()
 {
     parent::register_post_types();
     if (!post_type_exists('wp-parser-constant')) {
         register_post_type('wp-parser-constant', array('has_archive' => 'constants', 'label' => __('Constants'), 'public' => true, 'rewrite' => array('feeds' => false, 'slug' => 'constant', 'with_front' => false), 'supports' => array('editor', 'excerpt', 'title')));
     }
 }
Example #3
0
 /**
  * Normalize parameters for field
  *
  * @param array $field
  *
  * @return array
  */
 static function normalize_field($field)
 {
     $field = wp_parse_args($field, array('post_type' => 'post', 'field_type' => 'select_advanced', 'parent' => false, 'query_args' => array()));
     /**
      * Set default placeholder
      * - If multiple post types: show 'Select a post'
      * - If single post type: show 'Select a %post_type_name%'
      */
     if (empty($field['placeholder'])) {
         $label = __('Select a post', 'meta-box');
         if (is_string($field['post_type']) && post_type_exists($field['post_type'])) {
             $post_type_object = get_post_type_object($field['post_type']);
             $label = sprintf(__('Select a %s', 'meta-box'), $post_type_object->labels->singular_name);
         }
         $field['placeholder'] = $label;
     }
     if ($field['parent']) {
         $field['multiple'] = false;
         $field['field_name'] = 'parent_id';
     }
     $field['query_args'] = wp_parse_args($field['query_args'], array('post_type' => $field['post_type'], 'post_status' => 'publish', 'posts_per_page' => -1));
     switch ($field['field_type']) {
         case 'select':
             return RWMB_Select_Field::normalize_field($field);
             break;
         case 'select_advanced':
         default:
             return RWMB_Select_Advanced_Field::normalize_field($field);
     }
 }
 public static function init()
 {
     global $ClevernessToDoList, $CTDL_Frontend_Checklist, $CTDL_Frontend_Admin, $CTDL_templates, $CTDL_Dashboard_Widget;
     if (is_admin()) {
         self::check_for_upgrade();
     }
     $general_options = get_option('CTDL_general') ? get_option('CTDL_general') : array();
     $advanced_options = get_option('CTDL_advanced') ? get_option('CTDL_advanced') : array();
     $permissions_options = get_option('CTDL_permissions') ? get_option('CTDL_permissions') : array();
     self::$settings = array_merge($general_options, $advanced_options, $permissions_options);
     self::$dashboard_settings = get_option('CTDL_dashboard_settings');
     self::include_files();
     if (!post_type_exists('todo')) {
         self::setup_custom_post_type();
     }
     if (!taxonomy_exists('todocategories')) {
         self::create_taxonomies();
     }
     self::call_wp_hooks();
     $ClevernessToDoList = new ClevernessToDoList();
     $CTDL_templates = new CTDL_Template_Loader();
     if (is_admin()) {
         new CTDL_Settings();
         $CTDL_Dashboard_Widget = new CTDL_Dashboard_Widget();
     }
     $CTDL_Frontend_Admin = new CTDL_Frontend_Admin();
     $CTDL_Frontend_Checklist = new CTDL_Frontend_Checklist();
     new CTDL_Frontend_List();
 }
/**
 * Add optional help tab content for supported child themes by ZigZagPress.
 *
 * @since 1.6.0
 *
 * @uses  ddw_gle_plugin_get_data()
 * @uses  post_type_exists()
 * @uses  CHILD_THEME_NAME
 */
function ddw_gle_admin_help_zigzagpress()
{
    echo '<h3>' . __('Plugin: Genesis Layout Extras', 'genesis-layout-extras') . ' <small>v' . esc_attr(ddw_gle_plugin_get_data('Version')) . '</small></h3>';
    echo '<h4>' . __('Custom Post Types by Child Themes', 'genesis-layout-extras') . ' &mdash; ' . __('by StudioPress', 'genesis-layout-extras') . '</h4>';
    /** Child Themes by ZigZagPress: Bijou, Engrave, Eshop, Megalithe, Single, Solo, Tequila, Vanilla */
    if (post_type_exists('portfolio')) {
        if (CHILD_THEME_NAME == 'Megalithe') {
            $gle_zzp_theme_check = 'Megalithe';
        } elseif (CHILD_THEME_NAME == 'Engrave Theme') {
            $gle_zzp_theme_check = 'Engrave';
        } elseif (CHILD_THEME_NAME == 'Vanilla') {
            $gle_zzp_theme_check = 'Vanilla';
        } elseif (CHILD_THEME_NAME == 'Solo') {
            $gle_zzp_theme_check = 'Solo';
        } elseif (CHILD_THEME_NAME == 'Bijou') {
            $gle_zzp_theme_check = 'Bijou';
        } elseif (CHILD_THEME_NAME == 'Eshop') {
            $gle_zzp_theme_check = 'Eshop';
        } elseif (CHILD_THEME_NAME == 'Single') {
            $gle_zzp_theme_check = 'Single';
        } elseif (CHILD_THEME_NAME == 'Tequila') {
            $gle_zzp_theme_check = 'Tequila';
        } elseif (CHILD_THEME_NAME == 'Prestige') {
            $gle_zzp_theme_check = 'Prestige';
        } elseif (CHILD_THEME_NAME == 'Neo') {
            $gle_zzp_theme_check = 'Neo';
        }
        echo '<p>' . sprintf(__('Child Theme: %s by ZigZagPress', 'genesis-layout-extras'), $gle_zzp_theme_check) . '</p>' . '<ul>' . '<li>' . __('Portfolio Post Type Layout (archive)', 'genesis-layout-extras') . '</li>' . '<li>' . __('Portfolio Categories Taxonomy Layout', 'genesis-layout-extras') . '</li>' . '</ul>';
    }
    // end-if ZigZagPress check
}
Example #6
0
 protected function updateRaw()
 {
     if (!post_type_exists($this->name)) {
         $this->register();
     }
     $this->raw = get_post_type_object($this->name);
 }
 /**
  * Plugin Loader init
  * @static
  * @since 1.0
  */
 public static function init()
 {
     global $PostPlannerSettings;
     self::check_for_upgrade();
     $general_options = get_option('PostPlanner_general') ? get_option('PostPlanner_general') : array();
     $advanced_options = get_option('PostPlanner_advanced') ? get_option('PostPlanner_advanced') : array();
     self::$settings = array_merge($general_options, $advanced_options);
     self::$statuses = self::setup_statuses();
     if (PostPlanner_Loader::check_plugin_access() == false) {
         return;
     }
     if (PostPlanner_Loader::$settings['checklist'] == 1) {
         self::$checklist = get_option('PostPlanner_checklist');
     }
     self::include_files();
     if (!post_type_exists('planner')) {
         self::setup_custom_post_type();
     }
     if (!taxonomy_exists('plannercategories')) {
         self::create_taxonomies();
     }
     $PostPlannerSettings = new PostPlanner_Settings();
     if (!defined('PP_CTDL')) {
         if (in_array('cleverness-to-do-list/cleverness-to-do-list.php', apply_filters('active_plugins', get_option('active_plugins'))) && PostPlanner_Loader::$settings['ctdl'] == 1) {
             define('PP_CTDL', true);
         } else {
             define('PP_CTDL', false);
         }
     }
     self::setup_metaboxes();
     self::call_wp_hooks();
     new PostPlanner_Dashboard_Widget();
 }
Example #8
0
/**
 * Allows pages to be publicly queryable
 * @return void
 */
function basey_page_query()
{
    if (post_type_exists('page')) {
        global $wp_post_types;
        $wp_post_types['page']->publicly_queryable = true;
    }
}
 public static function is_active($data)
 {
     $is_active = false;
     if (isset($_REQUEST['flow_page'])) {
         $is_active = $_REQUEST['flow_page'] == $data['page_slug'];
     } elseif (!empty($data)) {
         global $post, $current_user, $pagenow;
         $post = !$post ? isset($_REQUEST['post']) ? get_post($_REQUEST['post']) : false : $post;
         foreach ($data as $key => $value) {
             $value = is_array($value) ? array_filter($value) : $value;
             if (!empty($value)) {
                 switch ($key) {
                     case 'post_type':
                         $is_active = ($post ? $post->post_type : (isset($_REQUEST['post_type']) && post_type_exists($_REQUEST['post_type']) ? $_REQUEST['post_type'] : null)) == $value;
                         break;
                     case 'page':
                         $is_active = is_array($value) && in_array($pagenow, $value) || is_string($value) && $pagenow == $value;
                         break;
                 }
             }
         }
     }
     if ($is_active) {
         $data['active'] = true;
     }
     return $data;
 }
Example #10
0
 function custom_content()
 {
     if (!post_type_exists($this->prefix . 'media')) {
         $args = array('supports' => array(), 'hierarchical' => false, 'public' => false, 'show_ui' => false, 'show_in_menu' => false, 'show_in_nav_menus' => false, 'show_in_admin_bar' => false, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => $this->prefix . 'media');
         register_post_type($this->prefix . 'media', $args);
     }
 }
 static function check_version_update()
 {
     //check if the apto_sort post type exists, oterwise call the function to register it
     if (!post_type_exists('apto_sort')) {
         APTO_register_post_types();
     }
     //check on the database version and if need update
     $settings = APTO_functions::get_settings();
     //check the table
     if (!isset($settings['database_version']) || version_compare($settings['database_version'], APTO_DB_VERSION, '<')) {
         self::update_tables();
     }
     //check for settings
     if (!isset($settings['plugin_version']) || version_compare($settings['plugin_version'], 1, '<=')) {
         self::create_settings();
     } else {
         if (version_compare($settings['plugin_version'], APTO_VERSION, '<')) {
             self::update_from_old_version_settings();
         }
     }
     //refetch the latest settings dataset
     $settings = APTO_functions::get_settings();
     //use a later filter to import from an older format
     if (isset($settings['schedule_data_import']) && $settings['schedule_data_import'] === TRUE) {
         unset($settings['schedule_data_import']);
         add_action('admin_menu', array(__CLASS__, 'old_version_data_import'), 98);
         APTO_functions::update_settings($settings);
     }
     //run a later filter to create sorts for every post type
     if (isset($settings['schedule_create_default_sorts']) && $settings['schedule_create_default_sorts'] === TRUE) {
         unset($settings['schedule_create_default_sorts']);
         add_action('admin_menu', array(__CLASS__, 'create_default_sorts'), 98);
         APTO_functions::update_settings($settings);
     }
 }
/**
 * Third meta box - optional: setting up the setting fields & labels.
 *    For supported 'ZigZagPress' child themes with CPTs.
 *
 * @since 1.6.0
 *
 * @uses  post_type_exists()
 * @uses  ddw_genesis_layout_extras_option()
 * @uses  CHILD_THEME_NAME
 *
 * @param $gle_zzp_theme_check
 * @param $gle_zzp_theme
 */
function ddw_genesis_layout_extras_box_zigzagpress()
{
    /** Description - user info: Child Theme generated special Custom Post Type sections */
    echo '<h4>' . __('Special Custom Post Type Sections', 'genesis-layout-extras') . '</h4>';
    echo '<p><span class="description">' . __('Here you can set up a <strong>default</strong> layout option for various extra archive pages generated by Custom Post Types which were set by child themes.', 'genesis-layout-extras') . ' ' . sprintf(__('%1$sGenesis Default%2$s in the drop-down menus below always means the chosen default layout option in the regular <a href="%3$s">Genesis layout settings</a>.', 'genesis-layout-extras'), '<code style="font-style: normal; color: #333;">', '</code>', admin_url('admin.php?page=genesis#genesis-theme-settings-layout')) . '</span></p>';
    /** Child Themes by ZigZagPress: Bijou, Engrave, Eshop, Megalithe, Single, Solo, Tequila, Vanilla */
    if (post_type_exists('portfolio')) {
        if (CHILD_THEME_NAME == 'Megalithe') {
            $gle_zzp_theme_check = 'Megalithe';
        } elseif (CHILD_THEME_NAME == 'Engrave Theme') {
            $gle_zzp_theme_check = 'Engrave';
        } elseif (CHILD_THEME_NAME == 'Vanilla') {
            $gle_zzp_theme_check = 'Vanilla';
        } elseif (CHILD_THEME_NAME == 'Solo') {
            $gle_zzp_theme_check = 'Solo';
        } elseif (CHILD_THEME_NAME == 'Bijou') {
            $gle_zzp_theme_check = 'Bijou';
        } elseif (CHILD_THEME_NAME == 'Eshop') {
            $gle_zzp_theme_check = 'Eshop';
        } elseif (CHILD_THEME_NAME == 'Single') {
            $gle_zzp_theme_check = 'Single';
        } elseif (CHILD_THEME_NAME == 'Tequila') {
            $gle_zzp_theme_check = 'Tequila';
        }
        $gle_zzp_theme = sprintf(__('Child Theme: %s by ZigZagPress', 'genesis-layout-extras'), $gle_zzp_theme_check);
        echo '<hr class="div" />';
        echo '<h4>' . $gle_zzp_theme . '</h4>';
        ddw_genesis_layout_extras_option(__('Portfolio Post Type Layout (archive)', 'genesis-layout-extras') . ': ', 'ddw_genesis_layout_cpt_child_portfolio');
        ddw_genesis_layout_extras_option(__('Portfolio Categories Taxonomy Layout', 'genesis-layout-extras') . ': ', 'ddw_genesis_layout_cpt_child_portfolio_category');
        ddw_gle_save_button();
    }
    // end-if zigzagpress portfolio check
}
Example #13
0
/**
 * Create a custom post type
 */
function fluxi_register_post_type($post_type, $label_plural, $args, $feminin = false, $labels = array())
{
    // Verify if the post_type exist
    if (post_type_exists($post_type) === true) {
        return false;
    }
    // Singular post_type label
    $label = isset($labels['singular_name']) ? $labels['singular_name'] : substr($label_plural, 0, -1);
    // Default parameters
    $default_labels = array('name' => $label_plural, 'singular_name' => $label, 'menu_name' => $label_plural, 'all_items' => 'Liste', 'add_new' => __('Ajouter'), 'add_new_item' => 'Ajouter un nouveau ' . strtolower($label), 'edit_item' => 'Modifier un ' . strtolower($label), 'new_item' => 'Nouveau ' . strtolower($label), 'view_item' => 'Voir', 'search_items' => 'Chercher un ' . strtolower($label), 'not_found' => 'Aucun ' . strtolower($label) . ' trouvé.', 'not_found_in_trash' => 'Aucun ' . strtolower($label) . ' trouvé dans la corbeille.');
    // Feminin
    if ($feminin !== false) {
        foreach ($default_labels as $key => $val) {
            $default_labels[$key] = str_replace(array(' un ', ' nouveau', 'Nouveau ', 'Aucun ', ' trouvé'), array(' une ', ' nouvelle', 'Nouvelle ', 'Aucune ', ' trouvée'), $val);
        }
    }
    // Overwrite default label parameters
    foreach ($labels as $key => $val) {
        $default_labels[$key] = $val;
    }
    $default_args = array('labels' => $default_labels, 'public' => true, 'show_ui' => true, 'show_in_rest' => false, 'rest_base' => '', 'show_in_menu' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => $post_type, 'with_front' => true), 'query_var' => true, 'supports' => array('title', 'editor', 'author'), 'exclude_from_search' => false, 'has_archive' => false, 'map_meta_cap' => true, 'taxonomies' => array('category', 'post_tag'));
    // Overwrite default parameters
    foreach ($args as $key => $val) {
        $default_args[$key] = $val;
    }
    // Register the post type
    return register_post_type($post_type, $default_args);
}
Example #14
0
 /**
  * Constructor. Builds our CPT.
  * @since 0.1.0
  * @param mixed  $cpt           Array with Singular, Plural, and Registered (slug)
  * @param array  $arg_overrides CPT registration override arguments
  */
 public function __construct(array $cpt, $arg_overrides = array())
 {
     if (!is_array($cpt)) {
         wp_die(__('It is required to pass a single, plural and slug string to CPT_Core', 'cpt-core'));
     }
     if (!isset($cpt[0], $cpt[1], $cpt[2])) {
         wp_die(__('It is required to pass a single, plural and slug string to CPT_Core', 'cpt-core'));
     }
     if (!is_string($cpt[0]) || !is_string($cpt[1]) || !is_string($cpt[2])) {
         wp_die(__('It is required to pass a single, plural and slug string to CPT_Core', 'cpt-core'));
     }
     if (post_type_exists($cpt[2])) {
         return;
     }
     $this->singular = $cpt[0];
     $this->plural = !isset($cpt[1]) || !is_string($cpt[1]) ? $cpt[0] . 's' : $cpt[1];
     $this->post_type = !isset($cpt[2]) || !is_string($cpt[2]) ? sanitize_title($this->plural) : $cpt[2];
     $this->arg_overrides = (array) $arg_overrides;
     // load text domain
     add_action('plugins_loaded', array($this, 'l10n'), 5);
     add_action('init', array($this, 'register_post_type'));
     add_filter('post_updated_messages', array($this, 'messages'));
     add_filter('manage_edit-' . $this->post_type . '_columns', array($this, 'columns'));
     add_filter('manage_edit-' . $this->post_type . '_sortable_columns', array($this, 'sortable_columns'));
     // Different column registration for pages/posts
     $h = isset($arg_overrides['hierarchical']) && $arg_overrides['hierarchical'] ? 'pages' : 'posts';
     add_action("manage_{$h}_custom_column", array($this, 'columns_display'), 10, 2);
     add_filter('enter_title_here', array($this, 'title'));
     add_action('deactivated_plugin', array($this, 'flush_permalink'), 10, 2);
 }
 /**
  * Custom post type
  *
  * @param   array   $cpt
  */
 function __construct($cpt)
 {
     $this->the_post_type = Riesma::slugify($cpt['post_type']);
     $this->labels = $cpt['labels'];
     // Setup all labels
     /*
     $lang = get_language_function_still_to_write();
     // Dutch
     if ( $lang == 'nl' ) {
     
     	if ( is_array( $this->labels ) ) {
     		$this->name     = Riesma::titleify( $this->labels['name'] );
     		$this->plural   = Riesma::titleify( $this->labels['plural'] );
     		$this->singular = Riesma::titleify( $this->labels['singular'] );
     	}
     	else {
     		$this->name     = Riesma::titleify( $this->labels . 's' );
     		$this->plural   = Riesma::titleify( $this->labels . 's' );
     		$this->singular = Riesma::titleify( $this->labels );
     	}
     
     	$this->hierarchical = !empty( $cpt['hierarchical'] ) ? $cpt['hierarchical'] : false;
     	$this->taxonomies   = !empty( $cpt['taxonomies'] ) ? $cpt['taxonomies'] : false;
     	$this->supports     = !empty( $cpt['supports'] ) ? $cpt['supports'] : $this->supports_default;
     	$this->slug         = Riesma::slugify( $this->name );
     	$this->icon         = Riesma::iconify( $this->the_post_type );
     }
     
     // English
     else {
     
     	if ( is_array( $this->labels ) ) {
     		$this->name          = Riesma::titleify( $this->labels['name'] );
     		$this->singular_name = Riesma::titleify( $this->labels['singular'] );
     		$this->plural        = Riesma::textify( $this->labels['plural'] );
     		$this->singular      = Riesma::textify( $this->labels['singular'] );
     	}
     	else {
     		$this->name          = Riesma::titleify( Riesma::pluralify( $this->labels ) );
     		$this->singular_name = Riesma::titleify( $this->labels );
     		$this->plural        = Riesma::textify( Riesma::pluralify( $this->labels ) );
     		$this->singular      = Riesma::textify( $this->labels );
     	}
     }
     */
     $this->name = Riesma::titleify($this->labels['name']);
     $this->singular_name = Riesma::titleify($this->labels['singular']);
     $this->plural = Riesma::textify($this->labels['plural']);
     $this->singular = Riesma::textify($this->labels['singular']);
     $this->hierarchical = !empty($cpt['hierarchical']) ? $cpt['hierarchical'] : false;
     $this->taxonomies = !empty($cpt['taxonomies']) ? $cpt['taxonomies'] : false;
     $this->supports = !empty($cpt['supports']) ? $cpt['supports'] : $this->supports_default;
     $this->slug = Riesma::slugify($this->name);
     $this->icon = Riesma::iconify($this->the_post_type);
     // Add the post type, if it does not exist yet
     if (!post_type_exists($this->the_post_type)) {
         add_action('init', array($this, 'register_post_type'));
         add_action('init', array($this, 'register_taxonomy'));
     }
 }
Example #16
0
function avia_temp_products()
{
    if (post_type_exists('product')) {
        return false;
    }
    $product_base = $base_slug = $category_base = "";
    register_taxonomy('product_cat', array('product'), array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories', 'woothemes'), 'labels' => array('name' => __('Categories', 'woothemes'), 'singular_name' => __('Product Category', 'woothemes'), 'search_items' => __('Search Product Categories', 'woothemes'), 'all_items' => __('All Product Categories', 'woothemes'), 'parent_item' => __('Parent Product Category', 'woothemes'), 'parent_item_colon' => __('Parent Product Category:', 'woothemes'), 'edit_item' => __('Edit Product Category', 'woothemes'), 'update_item' => __('Update Product Category', 'woothemes'), 'add_new_item' => __('Add New Product Category', 'woothemes'), 'new_item_name' => __('New Product Category Name', 'woothemes')), 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => $category_base . _x('product-category', 'slug', 'woothemes'), 'with_front' => false)));
    register_taxonomy('product_tag', array('product'), array('hierarchical' => false, 'label' => __('Tags', 'woothemes'), 'labels' => array('name' => __('Tags', 'woothemes'), 'singular_name' => __('Product Tag', 'woothemes'), 'search_items' => __('Search Product Tags', 'woothemes'), 'all_items' => __('All Product Tags', 'woothemes'), 'parent_item' => __('Parent Product Tag', 'woothemes'), 'parent_item_colon' => __('Parent Product Tag:', 'woothemes'), 'edit_item' => __('Edit Product Tag', 'woothemes'), 'update_item' => __('Update Product Tag', 'woothemes'), 'add_new_item' => __('Add New Product Tag', 'woothemes'), 'new_item_name' => __('New Product Tag Name', 'woothemes')), 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => $category_base . _x('product-tag', 'slug', 'woothemes'), 'with_front' => false)));
    register_post_type("product", array('labels' => array('name' => __('Products', 'woothemes'), 'singular_name' => __('Product', 'woothemes'), 'add_new' => __('Add Product', 'woothemes'), 'add_new_item' => __('Add New Product', 'woothemes'), 'edit' => __('Edit', 'woothemes'), 'edit_item' => __('Edit Product', 'woothemes'), 'new_item' => __('New Product', 'woothemes'), 'view' => __('View Product', 'woothemes'), 'view_item' => __('View Product', 'woothemes'), 'search_items' => __('Search Products', 'woothemes'), 'not_found' => __('No Products found', 'woothemes'), 'not_found_in_trash' => __('No Products found in trash', 'woothemes'), 'parent' => __('Parent Product', 'woothemes')), 'description' => __('This is where you can add new products to your store.', 'woothemes'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => true, 'rewrite' => array('slug' => $product_base, 'with_front' => false), 'query_var' => true, 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments'), 'has_archive' => $base_slug, 'show_in_nav_menus' => false));
    register_post_type("product_variation", array('labels' => array('name' => __('Variations', 'woothemes'), 'singular_name' => __('Variation', 'woothemes'), 'add_new' => __('Add Variation', 'woothemes'), 'add_new_item' => __('Add New Variation', 'woothemes'), 'edit' => __('Edit', 'woothemes'), 'edit_item' => __('Edit Variation', 'woothemes'), 'new_item' => __('New Variation', 'woothemes'), 'view' => __('View Variation', 'woothemes'), 'view_item' => __('View Variation', 'woothemes'), 'search_items' => __('Search Variations', 'woothemes'), 'not_found' => __('No Variations found', 'woothemes'), 'not_found_in_trash' => __('No Variations found in trash', 'woothemes'), 'parent' => __('Parent Variation', 'woothemes')), 'public' => true, 'show_ui' => false, 'capability_type' => 'post', 'publicly_queryable' => true, 'exclude_from_search' => true, 'hierarchical' => true, 'rewrite' => false, 'query_var' => true, 'supports' => array('title', 'editor', 'custom-fields', 'page-attributes', 'thumbnail'), 'show_in_nav_menus' => false));
    register_taxonomy('product_type', array('product'), array('hierarchical' => false, 'show_ui' => false, 'query_var' => true, 'show_in_nav_menus' => false));
    register_post_type("shop_order", array('labels' => array('name' => __('Orders', 'woothemes'), 'singular_name' => __('Order', 'woothemes'), 'add_new' => __('Add Order', 'woothemes'), 'add_new_item' => __('Add New Order', 'woothemes'), 'edit' => __('Edit', 'woothemes'), 'edit_item' => __('Edit Order', 'woothemes'), 'new_item' => __('New Order', 'woothemes'), 'view' => __('View Order', 'woothemes'), 'view_item' => __('View Order', 'woothemes'), 'search_items' => __('Search Orders', 'woothemes'), 'not_found' => __('No Orders found', 'woothemes'), 'not_found_in_trash' => __('No Orders found in trash', 'woothemes'), 'parent' => __('Parent Orders', 'woothemes')), 'description' => __('This is where store orders are stored.', 'woothemes'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_in_menu' => 'woocommerce', 'hierarchical' => false, 'show_in_nav_menus' => false, 'rewrite' => false, 'query_var' => true, 'supports' => array('title', 'comments', 'custom-fields'), 'has_archive' => false));
    register_taxonomy('shop_order_status', array('shop_order'), array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'labels' => array('name' => __('Order statuses', 'woothemes'), 'singular_name' => __('Order status', 'woothemes'), 'search_items' => __('Search Order statuses', 'woothemes'), 'all_items' => __('All  Order statuses', 'woothemes'), 'parent_item' => __('Parent Order status', 'woothemes'), 'parent_item_colon' => __('Parent Order status:', 'woothemes'), 'edit_item' => __('Edit Order status', 'woothemes'), 'update_item' => __('Update Order status', 'woothemes'), 'add_new_item' => __('Add New Order status', 'woothemes'), 'new_item_name' => __('New Order status Name', 'woothemes')), 'show_ui' => false, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => false));
    register_post_type("shop_coupon", array('labels' => array('name' => __('Coupons', 'woothemes'), 'singular_name' => __('Coupon', 'woothemes'), 'add_new' => __('Add Coupon', 'woothemes'), 'add_new_item' => __('Add New Coupon', 'woothemes'), 'edit' => __('Edit', 'woothemes'), 'edit_item' => __('Edit Coupon', 'woothemes'), 'new_item' => __('New Coupon', 'woothemes'), 'view' => __('View Coupons', 'woothemes'), 'view_item' => __('View Coupon', 'woothemes'), 'search_items' => __('Search Coupons', 'woothemes'), 'not_found' => __('No Coupons found', 'woothemes'), 'not_found_in_trash' => __('No Coupons found in trash', 'woothemes'), 'parent' => __('Parent Coupon', 'woothemes')), 'description' => __('This is where you can add new coupons that customers can use in your store.', 'woothemes'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'publicly_queryable' => true, 'exclude_from_search' => true, 'show_in_menu' => 'woocommerce', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title'), 'show_in_nav_menus' => false));
    if (!taxonomy_exists('product_type')) {
        register_taxonomy('product_type', array('post'));
        register_taxonomy('shop_order_status', array('post'));
    }
    $product_types = array('simple', 'grouped', 'variable', 'downloadable', 'virtual');
    foreach ($product_types as $type) {
        if (!get_term_by('slug', sanitize_title($type), 'product_type')) {
            wp_insert_term($type, 'product_type');
        }
    }
    $order_status = array('pending', 'failed', 'on-hold', 'processing', 'completed', 'refunded', 'cancelled');
    foreach ($order_status as $status) {
        if (!get_term_by('slug', sanitize_title($status), 'shop_order_status')) {
            wp_insert_term($status, 'shop_order_status');
        }
    }
}
 public function __construct($post_id = null)
 {
     if (!post_type_exists('hocwp_mo')) {
         $this->register_post_type();
     }
     $this->post_id = $post_id;
 }
Example #18
0
 function register_post_types()
 {
     if (post_type_exists('cupid_gallery')) {
         return;
     }
     register_post_type('cupid_gallery', array('label' => __('Cupid Gallery', 'cupid'), 'description' => __('Gallery Description', 'cupid'), 'labels' => array('name' => 'Gallery', 'singular_name' => 'Gallery', 'menu_name' => __('Gallery', 'cupid'), 'parent_item_colon' => __('Parent Item:', 'cupid'), 'all_items' => __('All Gallery', 'cupid'), 'view_item' => __('View Item', 'cupid'), 'add_new_item' => __('Add New Gallery', 'cupid'), 'add_new' => __('Add New', 'cupid'), 'edit_item' => __('Edit Item', 'cupid'), 'update_item' => __('Update Item', 'cupid'), 'search_items' => __('Search Item', 'cupid'), 'not_found' => __('Not found', 'cupid'), 'not_found_in_trash' => __('Not found in Trash', 'cupid')), 'supports' => array('title', 'excerpt', 'thumbnail'), 'public' => true, 'has_archive' => true));
 }
function mesocolumn_theme_widgets_init()
{
    global $bp_active;
    register_sidebar(array('name' => __('Tabbed Sidebar', TEMPLATE_DOMAIN), 'id' => 'tabbed-sidebar', 'description' => __('Sidebar Tabbed widget area', TEMPLATE_DOMAIN), 'before_widget' => '<div class="tabbertab"><aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside></div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    register_sidebar(array('name' => __('Right Sidebar', TEMPLATE_DOMAIN), 'id' => 'right-sidebar', 'description' => __('Right sidebar widget area', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    if (class_exists('woocommerce')) {
        register_sidebar(array('name' => __('Shop Sidebar', TEMPLATE_DOMAIN), 'id' => 'shop-sidebar', 'description' => __('Widget area for WooCommerce Shop Pages', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    }
    if (class_exists('jigoshop')) {
        register_sidebar(array('name' => __('Shop Sidebar', TEMPLATE_DOMAIN), 'id' => 'shop-sidebar', 'description' => __('Widget area for Jigo Shop Pages', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    }
    if (post_type_exists('portfolio')) {
        register_sidebar(array('name' => __('Portfolio Sidebar', TEMPLATE_DOMAIN), 'id' => 'portfolio-sidebar', 'description' => __('Widget area for Portfolio Pages', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    }
    if (class_exists('bbPress')) {
        register_sidebar(array('name' => __('Forum Sidebar', TEMPLATE_DOMAIN), 'id' => 'forum-sidebar', 'description' => __('Widget area for BBPress Forum Pages', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    }
    if ($bp_active == 'true') {
        register_sidebar(array('name' => __('BuddyPress Sidebar', TEMPLATE_DOMAIN), 'id' => 'buddypress-sidebar', 'description' => __('Widget area for BuddyPress Pages', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    }
    register_sidebar(array('name' => __('First Footer Widget Area', TEMPLATE_DOMAIN), 'id' => 'first-footer-widget-area', 'description' => __('The first footer widget area', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => __('Second Footer Widget Area', TEMPLATE_DOMAIN), 'id' => 'second-footer-widget-area', 'description' => __('The second footer widget area', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => __('Third Footer Widget Area', TEMPLATE_DOMAIN), 'id' => 'third-footer-widget-area', 'description' => __('The third footer widget area', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => __('Fourth Footer Widget Area', TEMPLATE_DOMAIN), 'id' => 'fourth-footer-widget-area', 'description' => __('The fourth footer widget area', TEMPLATE_DOMAIN), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
}
Example #20
0
 /**
  * Initialize by constructing metaboxes based on supported post formats
  *
  * @since 1.0
  */
 public function init()
 {
     if ($post_formats_support = get_theme_support('post-formats')) {
         /* Get supported post formats */
         if (!isset($post_formats_support[0]) || !is_array($post_formats_support[0])) {
             $post_formats_support = get_post_format_slugs();
         } else {
             $post_formats_support = $post_formats_support[0];
         }
         /* Prepare post format metaboxes */
         $this->metaboxes = array();
         foreach ($post_formats_support as $post_format) {
             if (is_callable("youxi_post_format_{$post_format}_metabox")) {
                 $metabox_id = youxi_post_format_id($post_format);
                 $metabox = call_user_func("youxi_post_format_{$post_format}_metabox");
                 $this->metaboxes[$post_format] = array_merge(array('id' => $metabox_id, 'html_classes' => array('youxi-metabox')), $metabox);
             }
         }
         /* Attach metabox on each supported post types */
         foreach ((array) youxi_post_format_post_types() as $post_type) {
             /* Make sure it's an existing post type */
             if (!post_type_exists($post_type)) {
                 continue;
             }
             /* Get the post type wrapper object */
             $post_type_object = Youxi_Post_Type::get($post_type);
             /* Add the metaboxes */
             foreach ($this->metaboxes as $metabox) {
                 $post_type_object->add_meta_box(new Youxi_Metabox($metabox['id'], $metabox));
             }
         }
         /* Prepare on the 'add_meta_boxes' hook */
         add_action('add_meta_boxes', array($this, 'prepare'));
     }
 }
Example #21
0
/**
 * Prefix of meta keys (optional)
 * Use underscore (_) at the beginning to make keys hidden
 * Alt.: You also can make prefix empty to disable it
*/
function sd_register_meta_boxes($meta_boxes)
{
    if (post_type_exists('professors')) {
        $types = get_terms('course_discipline', 'hide_empty=0');
        $types_array[0] = 'All Disciplines';
        if ($types) {
            foreach ($types as $type) {
                $types_array[$type->term_id] = $type->name;
            }
        }
    }
    $prefix = 'sd_';
    if (post_type_exists('professors')) {
        $meta_boxes[] = array('id' => 'professors_page_options', 'title' => 'Professors Template Options', 'pages' => array('page'), 'context' => 'normal', 'fields' => array(array('name' => 'Select Professors Disciplines', 'id' => $prefix . "professors-taxonomies", 'type' => 'checkbox_list', 'options' => $types_array, 'desc' => 'Optional. Only if you use this page as a professors page. Choose which professors discipline you want to display on this page (If Professors Template is chosen).')));
    }
    if (post_type_exists('events')) {
        $meta_boxes[] = array('id' => 'events_page_options', 'title' => 'Professors Template Options', 'pages' => array('events'), 'context' => 'normal', 'fields' => array(array('name' => __('Event Date', 'sd-framework'), 'id' => $prefix . "event_date", 'type' => 'date', 'desc' => __('Insert the event date', 'sd-framework'), 'js_options' => array('autoSize' => true, 'dateFormat' => __('MM d, yy', 'sd-framework'), 'showButtonPanel' => true)), array('name' => __('From', 'sd-framework'), 'id' => $prefix . "event_time_from", 'type' => 'time', 'js_options' => array('timeFormat' => 'hh:mm tt', 'ampm' => true)), array('name' => __('To', 'sd-framework'), 'id' => $prefix . "event_time_to", 'type' => 'time', 'js_options' => array('timeFormat' => 'hh:mm tt', 'ampm' => true))));
    }
    if (post_type_exists('professors')) {
        $meta_boxes[] = array('id' => 'professors_meta_options', 'title' => 'Professor Options', 'pages' => array('professors'), 'context' => 'normal', 'fields' => array(array('name' => 'Email Address', 'id' => $prefix . "professor_email", 'type' => 'text', 'desc' => 'Professor\'s Email Address.'), array('name' => 'Facebook URL', 'id' => $prefix . "professor_facebook", 'type' => 'text', 'desc' => 'Professor\'s Facebook URL.'), array('name' => 'Twitter URL', 'id' => $prefix . "professor_twitter", 'type' => 'text', 'desc' => 'Professor\'s Twitter URL.'), array('name' => 'Google Plus URL', 'id' => $prefix . "professor_google", 'type' => 'text', 'desc' => 'Professor\'s Google Plus URL.'), array('name' => 'Skype Id', 'id' => $prefix . "professor_skype", 'type' => 'text', 'desc' => 'Professor\'s Skype Id.')));
    }
    $meta_boxes[] = array('id' => 'page_options', 'title' => 'Page Options', 'pages' => array('page', 'post', 'professors', 'courses', 'events'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => 'Insert a Custom Page title or leave blank for default page title.', 'id' => $prefix . "page-title", 'type' => 'textarea', 'desc' => 'HTML code accepted.'), array('name' => 'Custom Header Page Background', 'desc' => 'Upload your custom header page background (optimal size 2170x213 for full image)', 'id' => $prefix . "header_page_bg", 'type' => 'image_advanced'), array('name' => 'Background No Repeat', 'id' => $prefix . "no_repeat", 'type' => 'checkbox', 'std' => '0', 'desc' => 'Header background no repeat'), array('name' => 'Background Repeat Horizontally', 'id' => $prefix . "repeat_x", 'type' => 'checkbox', 'std' => '0', 'desc' => 'Header background repeat horizontaly'), array('name' => 'Background Repeat Vertically', 'id' => $prefix . "repeat_y", 'type' => 'checkbox', 'std' => '0', 'desc' => 'Header background repeat vertically')));
    if (function_exists('smk_sidebar')) {
        $the_sidebars = smk_get_all_sidebars();
        $sidebar_options = array();
        foreach ($the_sidebars as $key => $value) {
            $sidebar_options[] = array($key => $value);
        }
        $sidebar_options = call_user_func_array('array_merge', $sidebar_options);
        $meta_boxes[] = array('id' => 'sidebar_options', 'title' => 'Sidebars', 'pages' => array('page', 'post', 'professors', 'courses'), 'context' => 'side', 'priority' => 'low', 'fields' => array(array('name' => 'Sidebar', 'id' => $prefix . "smk_sidebar", 'type' => 'select', 'desc' => 'Assign a custom sidebar to your page', 'options' => $sidebar_options)));
    }
    return $meta_boxes;
}
Example #22
0
function add_portfolio_counts()
{
    if (!post_type_exists('portfolio')) {
        return;
    }
    $num_posts = wp_count_posts('portfolio');
    $num = number_format_i18n($num_posts->publish);
    $text = _n('Project', 'Projects', intval($num_posts->publish));
    if (current_user_can('edit_posts')) {
        $num = "<a href='edit.php?post_type=portfolio'>{$num}</a>";
        $text = "<a href='edit.php?post_type=portfolio'>{$text}</a>";
    }
    echo '<td class="first b b-portfolio">' . $num . '</td>';
    echo '<td class="t portfolio">' . $text . '</td>';
    echo '</tr>';
    if ($num_posts->pending > 0) {
        $num = number_format_i18n($num_posts->pending);
        $text = _n('Project Pending', 'Projects Pending', intval($num_posts->pending));
        if (current_user_can('edit_posts')) {
            $num = "<a href='edit.php?post_status=pending&post_type=portfolio'>{$num}</a>";
            $text = "<a href='edit.php?post_status=pending&post_type=portfolio'>{$text}</a>";
        }
        echo '<td class="first b b-portfolio">' . $num . '</td>';
        echo '<td class="t portfolio">' . $text . '</td>';
        echo '</tr>';
    }
}
Example #23
0
 /**
  * Normalize parameters for field
  *
  * @param array $field
  *
  * @return array
  */
 static function normalize($field)
 {
     /**
      * Set default field args
      */
     $field = wp_parse_args($field, array('post_type' => 'post', 'field_type' => 'select', 'parent' => false, 'query_args' => array()));
     /**
      * Set default placeholder
      * - If multiple post types: show 'Select a post'
      * - If single post type: show 'Select a %post_type_name%'
      */
     if (empty($field['placeholder'])) {
         $field['placeholder'] = __('Select a post', 'meta-box');
         if (is_string($field['post_type']) && post_type_exists($field['post_type'])) {
             $post_type_object = get_post_type_object($field['post_type']);
             $field['placeholder'] = sprintf(__('Select a %s', 'meta-box'), $post_type_object->labels->singular_name);
         }
     }
     /**
      * Set parent option, which will change field name to `parent_id` to save as post parent
      */
     if ($field['parent']) {
         $field['multiple'] = false;
         $field['field_name'] = 'parent_id';
     }
     /**
      * Set default query args
      */
     $field['query_args'] = wp_parse_args($field['query_args'], array('post_status' => 'publish', 'posts_per_page' => -1));
     $field['query_args']['post_type'] = $field['post_type'];
     $field = parent::normalize($field);
     return $field;
 }
 /**
  * Construct a new Cuztom Post Type
  *
  * @param 	string|array 	$name
  * @param 	array 			$args
  * @param 	array 			$labels
  *
  * @author 	Gijs Jorissen
  * @since 	0.1
  *
  */
 function __construct($name, $args = array(), $labels = array())
 {
     if (!empty($name)) {
         // If $name is an array, the first element is the singular name, the second is the plural name
         if (is_array($name)) {
             $this->name = Cuztom::uglify($name[0]);
             $this->title = Cuztom::beautify($name[0]);
             $this->plural = Cuztom::beautify($name[1]);
         } else {
             $this->name = Cuztom::uglify($name);
             $this->title = Cuztom::beautify($name);
             $this->plural = Cuztom::pluralize(Cuztom::beautify($name));
         }
         $this->args = $args;
         $this->labels = $labels;
         $this->add_features = $this->remove_features = array();
         // Add to array for uninstall
         global $nm_uninstall;
         $nm_uninstall['post_types'][] = $this->name;
         // Add action to register the post type, if the post type doesnt exist
         if (!post_type_exists($this->name)) {
             add_action('init', array(&$this, 'register_post_type'));
         }
     }
 }
Example #25
0
/**
 * Get all page types that exists.
 *
 * @param  bool   $all
 * @param  string $post_type
 * @param  bool   $fake_post_types
 *
 * @return array
 */
function papi_get_all_page_types($all = false, $post_type = null, $fake_post_types = false)
{
    if (empty($post_type)) {
        $post_type = papi_get_post_type();
    }
    $cache_key = papi_cache_key(sprintf('%s_%s', $all, $post_type), $fake_post_types);
    $page_types = wp_cache_get($cache_key);
    $load_once = papi_filter_core_load_one_type_on();
    if (empty($page_types)) {
        $files = papi_get_all_page_type_files();
        foreach ($files as $file) {
            $page_type = papi_get_page_type($file);
            if (is_null($page_type)) {
                continue;
            }
            if ($page_type instanceof Papi_Page_Type === false) {
                continue;
            }
            if (papi()->exists('core.page_type.' . $page_type->post_type[0])) {
                if (!empty($page_types)) {
                    continue;
                }
            } else {
                if (in_array($page_type->post_type[0], $load_once)) {
                    papi()->singleton('core.page_type.' . $page_type->post_type[0], $page_type->get_id());
                }
            }
            if ($fake_post_types) {
                if (isset($page_type->post_type[0]) && !post_type_exists($page_type->post_type[0])) {
                    // Boot page type.
                    $page_type->boot();
                    // Add it to the page types array.
                    $page_types[] = $page_type;
                }
                continue;
            } else {
                if ($page_type instanceof Papi_Option_Type) {
                    continue;
                }
            }
            // Add the page type if the post types is allowed.
            if (!is_null($page_type) && papi_current_user_is_allowed($page_type->capabilities) && ($all || in_array($post_type, $page_type->post_type))) {
                // Boot page type.
                $page_type->boot();
                // Add it to the page types array.
                $page_types[] = $page_type;
            }
        }
        if (is_array($page_types)) {
            usort($page_types, function ($a, $b) {
                return strcmp($a->name, $b->name);
            });
            wp_cache_set($cache_key, $page_types);
        }
    }
    if (!is_array($page_types)) {
        return [];
    }
    return papi_sort_order(array_reverse($page_types));
}
Example #26
0
 /**
  * registers the polylang_mo custom post type, only at first object creation
  *
  * @since 1.2
  */
 public function __construct()
 {
     if (!post_type_exists('polylang_mo')) {
         $labels = array('name' => __('Strings translations', 'polylang'));
         register_post_type('polylang_mo', array('labels' => $labels, 'rewrite' => false, 'query_var' => false, '_pll' => true));
     }
 }
/**
 * Add optional help tab content for supported plugins.
 *
 * @since 1.3.0
 *
 * @uses  ddw_gle_help_content_sub_head()
 * @uses  post_type_exists()
 */
function ddw_gle_admin_help_plugins()
{
    ddw_gle_help_content_sub_head(__('Custom Post Types by Plugins', 'genesis-layout-extras'));
    /** Plugin: AgentPress Listings */
    if (post_type_exists('listing')) {
        echo '<h4>AgentPress Listings</h4>' . '<ul>' . '<li>' . __('Listing Post Type Layout (archive)', 'genesis-layout-extras') . '</li>' . '<li>' . __('Listings Features Taxonomy Layout', 'genesis-layout-extras') . '</li>' . '</ul>';
    }
    // end-if APL check
    /** Plugin: Genesis Media Project */
    if (post_type_exists('video')) {
        echo '<h4>' . __('Genesis Media Project', 'genesis-layout-extras') . '</h4>' . '<ul>' . '<li>' . __('Video Post Type Layout (archive)', 'genesis-layout-extras') . '</li>' . '<li>' . __('Video SlideShows Taxonomy Layout', 'genesis-layout-extras') . '</li>' . '<li>' . __('Video Categories Taxonomy Layout', 'genesis-layout-extras') . '</li>' . '<li>' . __('Video Tags Taxonomy Layout', 'genesis-layout-extras') . '</li>' . '</ul>';
    }
    // end-if GMP check
    /** Plugins: WooCommerce or Jigoshop */
    if (post_type_exists('product')) {
        echo '<h4>' . __('WooCommerce OR Jigoshop', 'genesis-layout-extras') . '</h4>' . '<ul>' . '<li>' . __('Product Post Type Layout - Product Categories (all)', 'genesis-layout-extras') . '</li>' . '<li>' . __('Product Post Type Layout - Product Tags (all)', 'genesis-layout-extras') . '</li>' . '<li>' . sprintf(__('%s Genesis Integration Plugin', 'genesis-layout-extras'), '<em>WooCommerce</em>') . ': <a href="http://wordpress.org/plugins/genesis-connect-woocommerce/" target="_new">Genesis Connect for WooCommerce</a> <small><em>(' . __('required', 'genesis-layout-extras') . ')</em></small></li>' . '<li>' . sprintf(__('%s Genesis Integration Plugin', 'genesis-layout-extras'), '<em>Jigoshop</em>') . ': <a href="http://jigoshop.com/product/genesis-connect-for-jigoshop/" target="_new">Genesis Connect for Jigoshop</a> <small><em>(' . __('required', 'genesis-layout-extras') . ')</em></small></li>' . '</ul>';
    }
    // end-if CPT "product" check
    /** Plugin: Easy Digital Downloads */
    if (post_type_exists('download')) {
        echo '<h4>' . __('Easy Digital Downloads', 'genesis-layout-extras') . '</h4>' . '<ul>' . '<li>' . __('Download Post Type Layout (archive)', 'genesis-layout-extras') . '</li>' . '<li>' . __('Download Categories Taxonomy Layout', 'genesis-layout-extras') . '</li>' . '<li>' . __('Download Tags Taxonomy Layout', 'genesis-layout-extras') . '</li>' . '<li>' . sprintf(__('%s Genesis Integration Plugin', 'genesis-layout-extras'), '<em>Easy Digital Downloads</em>') . ': <a href="http://wordpress.org/plugins/genesis-connect-woocommerce/" target="_new">Genesis Connect for Easy Digital Downloads</a> <small><em>(' . __('recommended', 'genesis-layout-extras') . ')</em></small></li>' . '</ul>';
    }
    // end-if EDD check
    /** Plugin: Sugar Events Calendar */
    if (post_type_exists('sc_event')) {
        echo '<h4>' . __('Sugar Events Calendar', 'genesis-layout-extras') . '</h4>' . '<ul>' . '<li>' . __('Event Post Type Layout (archive)', 'genesis-layout-extras') . '</li>' . '<li>' . __('Event Categories Taxonomy Layout', 'genesis-layout-extras') . '</li>' . '</ul>';
    }
    // end-if Sugar Events check
    /** Plugin: bbPress 2.x Forum */
    if (class_exists('bbPress')) {
        echo '<h4>' . __('bbPress 2.x', 'genesis-layout-extras') . '</h4>' . '<ul>' . '<li>' . __('bbPress 2.x Forum Layout (all areas)', 'genesis-layout-extras') . '</li>' . '<li>' . __('Including extra setting for singular topics view', 'genesis-layout-extras') . '</li>' . '<li>' . sprintf(__('%s Genesis Integration Plugin', 'genesis-layout-extras'), '<em>bbPress</em>') . ': <a href="http://wordpress.org/plugins/bbpress-genesis-extend/" target="_new">bbPress Genesis Extend</a> <small><em>(' . __('required', 'genesis-layout-extras') . ')</em></small></li>' . '</ul>';
    }
    // end-if bbPress 2.x check
}
Example #28
0
function En_attente()
{
    $types = 'post';
    if (!post_type_exists('' . $types . '')) {
        return;
    }
    $num_posts = wp_count_posts('' . $types . '');
    $nbr_ = 'Post';
    $nbr_s = 'Posts';
    $num = number_format_i18n($num_posts->publish);
    $text = _n('' . $nbr_ . '', '' . $nbr_s . '', intval($num_posts->publish));
    if (current_user_can('edit_posts')) {
        $num = "<a href='edit.php?post_type={$types}'>{$num}</a>";
        $text = "<a href='edit.php?post_type={$types}'>{$text}</a>";
    }
    echo '<td class="first b">' . $num . '</td>';
    echo '<td class="t">' . $text . '</td>';
    echo '';
    if ($num_posts->pending > 0) {
        $num = number_format_i18n($num_posts->pending);
        $text = _n('En attente', 'En attentes', intval($num_posts->pending));
        if (current_user_can('edit_posts')) {
            $num = "<a href='edit.php?post_status=pending&post_type={$types}'>{$num}</a>";
            $text = "<a class=\"waiting\" href='wp-admin/edit.php?post_status=pending&post_type={$types}'>{$text}</a>";
        }
        echo '<td class="first b">' . $num . '</td>';
        echo '<td class="t">' . $text . '</td>';
        echo '';
    }
}
 function register_post_types()
 {
     if (post_type_exists(self::TESTIMONIAL_POST_TYPE)) {
         return;
     }
     register_post_type(self::TESTIMONIAL_POST_TYPE, array('description' => __('Customer Testimonials', 'jetpack'), 'labels' => array('name' => esc_html__('Testimonials', 'jetpack'), 'singular_name' => esc_html__('Testimonial', 'jetpack'), 'menu_name' => esc_html__('Testimonials', 'jetpack'), 'all_items' => esc_html__('All Testimonials', 'jetpack'), 'add_new' => esc_html__('Add New', 'jetpack'), 'add_new_item' => esc_html__('Add New Testimonial', 'jetpack'), 'edit_item' => esc_html__('Edit Testimonial', 'jetpack'), 'new_item' => esc_html__('New Testimonial', 'jetpack'), 'view_item' => esc_html__('View Testimonial', 'jetpack'), 'search_items' => esc_html__('Search Testimonials', 'jetpack'), 'not_found' => esc_html__('No Testimonials found', 'jetpack'), 'not_found_in_trash' => esc_html__('No Testimonials found in Trash', 'jetpack')), 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'), 'rewrite' => array('slug' => 'testimonial', 'with_front' => false, 'feeds' => false, 'pages' => false), 'public' => true, 'show_ui' => true, 'menu_position' => 20, 'capability_type' => 'page', 'map_meta_cap' => true, 'has_archive' => true, 'query_var' => 'testimonial'));
 }
 /**
  * Register core post types.
  */
 public static function register_post_types()
 {
     if (post_type_exists('api_product')) {
         return;
     }
     register_post_type('api_product', apply_filters('register_post_type_api_product', array('labels' => array('name' => __('API Products', 'wp-product-licensing'), 'singular_name' => __('API Product', 'wp-product-licensing'), 'menu_name' => _x('API Products', 'Admin menu name', 'wp-product-licensing'), 'all_items' => __('All API Products', 'wp-product-licensing'), 'add_new' => __('Add New', 'wp-product-licensing'), 'add_new_item' => __('Add API Product', 'wp-product-licensing'), 'edit' => __('Edit', 'wp-product-licensing'), 'edit_item' => __('Edit API Product', 'wp-product-licensing'), 'new_item' => __('New API Product', 'wp-product-licensing'), 'view' => __('View API Product', 'wp-product-licensing'), 'view_item' => __('View API Product', 'wp-product-licensing'), 'search_items' => __('Search API Products', 'wp-product-licensing'), 'not_found' => __('No API Products found', 'wp-product-licensing'), 'not_found_in_trash' => __('No API Products found in trash', 'wp-product-licensing'), 'parent' => __('Parent API Product', 'wp-product-licensing')), 'description' => __('This is where you can create and manage api products.', 'wp-product-licensing'), 'public' => false, 'show_ui' => true, 'capability_type' => 'post', 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'menu_icon' => 'dashicons-products', 'supports' => array('title'), 'has_archive' => false, 'show_in_nav_menus' => false)));
 }