/**
  * This registers any new statuses sent via the $new_stati array on construct
  *
  * @access protected
  * @param  array $new_stati statuses
  * @return void
  */
 protected function _register_new_stati($new_stati)
 {
     foreach ((array) $new_stati as $status_key => $status_args) {
         $args = array('label' => isset($status_args['label']) ? $status_args['label'] : $status_key, 'public' => isset($status_args['public']) && is_bool($status_args['public']) ? $status_args['public'] : TRUE, 'exclude_from_search' => isset($status_args['exclude_from_search']) && is_bool($status_args['exclude_from_search']) ? $status_args['exclude_from_search'] : FALSE, 'show_in_admin_all_list' => isset($status_args['show_in_admin_all_list']) && is_bool($status_args['show_in_admin_all_list']) ? $status_args['show_in_admin_all_list'] : FALSE, 'show_in_admin_status_list' => isset($status_args['show_in_admin_status_list']) && is_bool($status_args['show_in_admin_status_list']) ? $status_args['show_in_admin_status_list'] : TRUE, 'label_count' => isset($status_args['label_count']) ? $status_args['label_count'] : '');
         register_post_status($status_key, $status_args);
     }
 }
 /**
  * register_custom_post_statuses.
  */
 public function register_custom_post_statuses()
 {
     $wcj_orders_custom_statuses_array = '' == get_option('wcj_orders_custom_statuses_array') ? array() : get_option('wcj_orders_custom_statuses_array');
     foreach ($wcj_orders_custom_statuses_array as $slug => $label) {
         register_post_status($slug, array('label' => $label, 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop($label . ' <span class="count">(%s)</span>', $label . ' <span class="count">(%s)</span>')));
     }
 }
function hmwcpm_init()
{
    register_post_type('price_match_request', array('label' => 'Price Match Requests', 'public' => false, 'show_ui' => true, 'capabilities' => array('create_posts' => false), 'menu_position' => 56));
    register_post_status('hmwcpm_pending', array('label' => _x('Pending Review', 'hmwcpm'), 'public' => true, 'internal' => false, 'label_count' => _n_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')));
    register_post_status('hmwcpm_approved', array('label' => _x('Approved', 'hmwcpm'), 'public' => true, 'internal' => false, 'label_count' => _n_noop('Approved <span class="count">(%s)</span>', 'Approved <span class="count">(%s)</span>')));
    register_post_status('hmwcpm_denied', array('label' => _x('Denied', 'hmwcpm'), 'public' => true, 'internal' => false, 'label_count' => _n_noop('Denied <span class="count">(%s)</span>', 'Denied <span class="count">(%s)</span>')));
}
 public function test__unregister_post_status()
 {
     register_post_status('foo');
     _unregister_post_status('foo');
     $stati = get_post_stati();
     $this->assertFalse(isset($stati['foo']));
 }
Example #5
0
 /**
  * Post statuses for payments
  * @return  
  */
 private static function register_post_statuses()
 {
     $statuses = array(self::STATUS_AUTHORIZED => self::__('Authorized'), self::STATUS_CANCELLED => self::__('Cancelled'), self::STATUS_PARTIAL => self::__('Partial Payment'), self::STATUS_VOID => self::__('Void'), self::STATUS_REFUND => self::__('Refunded'), self::STATUS_RECURRING => self::__('Recurring'));
     foreach ($statuses as $status => $label) {
         register_post_status($status, array('label' => $label, 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop($label . ' <span class="count">(%s)</span>', $label . ' <span class="count">(%s)</span>')));
     }
 }
 public function dln_company_status_filters()
 {
     $types = self::get_company_status();
     foreach ($types as $name => $type) {
         register_post_status($name, array('label' => $type, 'private' => true, '_builtin' => true, 'label_count' => _n_noop($type . ' <span class="count">(%s)</span>', $type . ' <span class="count">(%s)</span>')));
     }
 }
Example #7
0
 function olr_new_post_status()
 {
     register_post_status('confirmed', array('label' => 'Confirmed', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>')));
     register_post_status('closed', array('label' => 'Closed', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Closed <span class="count">(%s)</span>', 'Closed <span class="count">(%s)</span>')));
     register_post_status('pending', array('label' => 'Pending', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>')));
     register_post_status('enquiry', array('label' => 'Enquiry', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Enquiry <span class="count">(%s)</span>', 'Enquiry <span class="count">(%s)</span>')));
 }
Example #8
0
 function __construct()
 {
     $this->add_shortcode();
     // While generating the output of a text widget with a contact-form shortcode, we need to know its widget ID.
     add_action('dynamic_sidebar', array($this, 'track_current_widget'));
     // Add a "widget" shortcode attribute to all contact-form shortcodes embedded in widgets
     add_filter('widget_text', array($this, 'widget_atts'), 0);
     // If Text Widgets don't get shortcode processed, hack ours into place.
     if (!has_filter('widget_text', 'do_shortcode')) {
         add_filter('widget_text', array($this, 'widget_shortcode_hack'), 5);
     }
     // Akismet to the rescue
     if (function_exists('akismet_http_post')) {
         add_filter('contact_form_is_spam', array($this, 'is_spam_akismet'), 10);
         add_action('contact_form_akismet', array($this, 'akismet_submit'), 10, 2);
     }
     add_action('loop_start', array('Grunion_Contact_Form', '_style_on'));
     // custom post type we'll use to keep copies of the feedback items
     register_post_type('feedback', array('labels' => array('name' => __('Feedbacks', 'jetpack'), 'singular_name' => __('Feedback', 'jetpack'), 'search_items' => __('Search Feedback', 'jetpack'), 'not_found' => __('No feedback found', 'jetpack'), 'not_found_in_trash' => __('No feedback found', 'jetpack')), 'menu_icon' => GRUNION_PLUGIN_URL . '/images/grunion-menu.png', 'show_ui' => TRUE, 'show_in_admin_bar' => FALSE, 'public' => FALSE, 'rewrite' => FALSE, 'query_var' => FALSE, 'capability_type' => 'page'));
     // Add "spam" as a post status
     register_post_status('spam', array('label' => 'Spam', 'public' => FALSE, 'exclude_from_search' => TRUE, 'show_in_admin_all_list' => FALSE, 'label_count' => _n_noop('Spam <span class="count">(%s)</span>', 'Spam <span class="count">(%s)</span>', 'jetpack'), 'protected' => TRUE, '_builtin' => FALSE));
     // POST handler
     if ('POST' == strtoupper($_SERVER['REQUEST_METHOD']) && isset($_POST['action']) && 'grunion-contact-form' == $_POST['action'] && isset($_POST['contact-form-id'])) {
         add_action('template_redirect', array($this, 'process_form_submission'));
     }
     /* Can be dequeued by placing the following in wp-content/themes/yourtheme/functions.php
      *
      * 	function remove_grunion_style() {
      *		wp_deregister_style('grunion.css');
      *	}
      *	add_action('wp_print_styles', 'remove_grunion_style');
      */
     wp_register_style('grunion.css', GRUNION_PLUGIN_URL . 'css/grunion.css', array(), JETPACK__VERSION);
 }
Example #9
0
function cfd_init()
{
    // allow on admin pages & xml-rpc requests
    if (is_admin() || defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
        $classname = 'cf_deploy_admin';
        if (defined('RAMP_DEBUG') && RAMP_DEBUG) {
            require_once 'classes/admin_tests.class.php';
            $classname .= '_tests';
        }
        $GLOBALS['cfd_admin'] = new $classname();
        if (is_cfd_page() || defined('DOING_AJAX') && DOING_AJAX || defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
            do_action('cfd_admin_init');
        }
    }
    // customizeable title name for menus and screens
    define('CF_DEPLOY_TITLE_NAME', apply_filters('cf-deploy-title-name', 'RAMP'));
    // Register a custom post type
    register_post_type(CF_DEPLOY_POST_TYPE, array('labels' => array('name' => CF_DEPLOY_TITLE_NAME . ' ' . __('Batch Items'), 'singular_name' => CF_DEPLOY_TITLE_NAME . ' ' . __('Batch Item')), 'description' => __('Deployment Mechanism'), 'public' => false, 'exclude_from_search' => true, 'publically_queryable' => false, 'show_ui' => false, 'show_in_nav_menus' => false, 'hierarchal' => false, 'can_export' => false, 'query_var' => false, 'supports' => array('title', 'author', 'excerpt', 'page-attributes', 'custom-fields'), 'taxonomies' => array(), 'capabilities' => array('manage_options')));
    /**
     * Active batch: draft
     * Pushed batch: publish
     * Imported batch: import
     *
     * This api is here, but is not fully implemented in the wp-admin.
     * As of right now this doesn't show anywhere but is queryable.
     * I claim no responsibility if this breaks in the future
     */
    register_post_status('import', array('label' => 'Import', '_edit_link' => 'admin.php?page=cf-ramp-batch&batch=%d', 'publicly_queryable' => false, 'show_in_admin_all_list' => false, 'show_in_admin_status_list' => false));
}
 private function registerPostStatus()
 {
     foreach (SLN_Enum_BookingStatus::toArray() as $k => $v) {
         register_post_status($k, array('label' => $v, 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop($v . ' <span class="count">(%s)</span>', $v . ' <span class="count">(%s)</span>')));
     }
     add_action('transition_post_status', array($this, 'transitionPostStatus'), 10, 3);
 }
 /**
  * Post statuses for payments
  * @return
  */
 private static function register_post_statuses()
 {
     $statuses = self::get_statuses();
     foreach ($statuses as $status => $label) {
         register_post_status($status, array('label' => $label, 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop($label . ' <span class="count">(%s)</span>', $label . ' <span class="count">(%s)</span>')));
     }
 }
Example #12
0
 /**
  * Register Post Statuses
  */
 public function register()
 {
     // preview post status
     register_post_status('preview', array('label' => _x('Preview', 'post status', 'wp-car-manager'), 'public' => false, 'exclude_from_search' => true, 'show_in_admin_all_list' => false, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Preview <span class="count">(%s)</span>', 'Preview <span class="count">(%s)</span>', 'wp-car-manager')));
     // expired post status
     register_post_status('expired', array('label' => _x('Expired', 'post status', 'wp-car-manager'), 'public' => false, 'protected' => true, 'exclude_from_search' => true, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Expired <span class="count">(%s)</span>', 'Expired <span class="count">(%s)</span>', 'wp-car-manager')));
 }
Example #13
0
function colabs_setup_orders()
{
    $statuses = array(COLABS_ORDER_PENDING => _n_noop('Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>', 'colabsthemes'), COLABS_ORDER_FAILED => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'colabsthemes'), COLABS_ORDER_COMPLETED => _n_noop('Completed <span class="count">(%s)</span>', 'Completed <span class="count">(%s)</span>', 'colabsthemes'), COLABS_ORDER_ACTIVATED => _n_noop('Activated <span class="count">(%s)</span>', 'Activated <span class="count">(%s)</span>', 'colabsthemes'));
    foreach ($statuses as $status => $translate_string) {
        register_post_status($status, array('public' => true, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => $translate_string));
    }
}
 function pre_get_posts(&$query)
 {
     if ($query->is_singular) {
         // This is a special post status for hiding posts that have expired
         register_post_status('expired', array('label' => 'Expired', 'exclude_from_search' => true, 'public' => true, 'publicly_queryable' => true, 'show_in_admin_all_list' => false, 'show_in_admin_status_list' => true));
     }
     return $query;
 }
Example #15
0
/**
 * Register escrow related payments statuses.
 *
 * @return void
 */
function _appthemes_register_escrow_statuses()
{
    if (!appthemes_is_escrow_enabled()) {
        return;
    }
    register_post_status(APPTHEMES_ORDER_PAID, array('public' => true, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Paid <span class="count">(%s)</span>', 'Paid <span class="count">(%s)</span>', APP_TD)));
    register_post_status(APPTHEMES_ORDER_REFUNDED, array('public' => true, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', APP_TD)));
}
 /**
  * Register custom post status - used by workflows.
  *
  * @since 2.0
  */
 public function register_custom_statuses()
 {
     $args = array('hide_empty' => false);
     $custom_statuses = get_terms($this->taxonomy_key, $args);
     foreach ($custom_statuses as $status) {
         register_post_status($status->slug, array('label' => $status->name, 'protected' => true, '_builtin' => false, 'label_count' => _n_noop("{$status->name} <span class='count'>(%s)</span>", "{$status->name} <span class='count'>(%s)</span>")));
     }
 }
 /**
  * Register the custom post status.
  */
 public function register_post_status()
 {
     /**
      * Filters the arguments passed to `register_post_status()`.
      *
      * @see register_post_status().
      */
     register_post_status($this->status, apply_filters('archiveless_post_status_args', array('label' => __('Hidden from Archives', 'archiveless'), 'label_count' => _n_noop('Hidden from Archives <span class="count">(%s)</span>', 'Hidden from Archives <span class="count">(%s)</span>', 'archiveless'), 'exclude_from_search' => true, 'public' => true, 'publicly_queryable' => true, 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true)));
 }
Example #18
0
function ifl_create_new_order_statuses()
{
    // Create the status that gets set when blade picks up the order for the first time
    register_post_status('wc-blade-processing', array('label' => 'Being processed by Blade', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Being processed by Blade <span class="count">(%s)</span>', 'Being processed by Blade <span class="count">(%s)</span>')));
    // Create the awaiting picking status
    register_post_status('wc-blade-picking', array('label' => 'Awaiting Picking', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Awaiting Picking <span class="count">(%s)</span>', 'Awaiting Picking <span class="count">(%s)</span>')));
    // Create the packed status
    register_post_status('wc-blade-packed', array('label' => 'Packed, Awaiting Despatch', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Packed, Awaiting Despatch <span class="count">(%s)</span>', 'Packed, Awaiting Despatch <span class="count">(%s)</span>')));
    // Create the packed status
    register_post_status('wc-blade-despatched', array('label' => 'Despatched', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Despatched <span class="count">(%s)</span>', 'Despatched <span class="count">(%s)</span>')));
}
 /**
  * Register our custom post statuses, used for paypal_ipn status
  * @since    1.0.0
  * @access   public
  */
 public static function paypal_ipn_for_wordpress_register_post_status()
 {
     global $wpdb;
     $ipn_post_status_list = self::paypal_ipn_for_wordpress_get_ipn_status();
     if (isset($ipn_post_status_list) && !empty($ipn_post_status_list)) {
         foreach ($ipn_post_status_list as $ipn_post_status) {
             $ipn_post_status_display_name = ucfirst(str_replace('_', ' ', $ipn_post_status));
             register_post_status($ipn_post_status, array('label' => _x($ipn_post_status_display_name, 'IPN status', 'paypal-ipn'), 'public' => $ipn_post_status == 'trash' ? false : true, 'exclude_from_search' => false, 'show_in_admin_all_list' => $ipn_post_status == 'trash' ? false : true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop($ipn_post_status_display_name . ' <span class="count">(%s)</span>', $ipn_post_status_display_name . ' <span class="count">(%s)</span>', 'paypal-ipn')));
         }
     }
 }
 /**
  * Add a new post status of "Unavailable"
  * 
  * @return void
  */
 public function add_post_status()
 {
     $defaults = array('label_count' => false, 'hierarchical' => false, 'public' => true, 'publicly_queryable' => null, 'internal' => false, 'exclude_from_search' => null, 'show_in_admin_all_list' => null, 'show_in_admin_status_list' => null, 'protected' => null, 'private' => null, 'show_in_admin_all' => null, 'capability_type' => 'post', 'single_view_cap' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d');
     // if FALSE, will take the 1st fn arg
     $defaults['label'] = __(ucwords(str_replace(array('_', '-'), array(' ', ' '), $this->post_status)), 'cps_textdomain');
     // Care about counters:
     // If FALSE, will be set to array( $args->label, $args->label ), which is not desired
     $defaults['label_count'] = _n_noop("{$defaults['label']} <span class='count'>(%s)</span>", "{$defaults['label']} <span class='count'>(%s)</span>", 'cps_textdomain');
     // Register the status: Merge Args with defaults
     register_post_status($this->post_status, wp_parse_args($this->args, $defaults));
 }
 /**
  * Register our custom post statuses, used for order status.
  */
 public function register_post_status()
 {
     register_post_status('payment_pending', array('label' => _x('Pending', 'Payment status', 'pronamic_ideal'), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>', 'pronamic_ideal')));
     register_post_status('payment_processing', array('label' => _x('Processing', 'Payment status', 'pronamic_ideal'), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'pronamic_ideal')));
     register_post_status('payment_on_hold', array('label' => _x('On Hold', 'Payment status', 'pronamic_ideal'), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'pronamic_ideal')));
     register_post_status('payment_completed', array('label' => _x('Completed', 'Payment status', 'pronamic_ideal'), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Completed <span class="count">(%s)</span>', 'Completed <span class="count">(%s)</span>', 'pronamic_ideal')));
     register_post_status('payment_cancelled', array('label' => _x('Cancelled', 'Payment status', 'pronamic_ideal'), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'pronamic_ideal')));
     register_post_status('payment_refunded', array('label' => _x('Refunded', 'Payment status', 'pronamic_ideal'), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'pronamic_ideal')));
     register_post_status('payment_failed', array('label' => _x('Failed', 'Payment status', 'pronamic_ideal'), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'pronamic_ideal')));
     register_post_status('payment_expired', array('label' => _x('Expired', 'Payment status', 'pronamic_ideal'), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Expired <span class="count">(%s)</span>', 'Expired <span class="count">(%s)</span>', 'pronamic_ideal')));
 }
 public function register_post_status()
 {
     $pts_args = array('show_in_admin_all_list' => false, 'label' => __('Recurrent', 'eab'));
     $pts_args['label_count'] = _n_noop('Recurrent <span class="count">(%s)</span>', 'Recurrent <span class="count">(%s)</span>', 'eab');
     if (is_admin()) {
         $pts_args['protected'] = true;
     } else {
         $pts_args['public'] = true;
     }
     register_post_status(Eab_EventModel::RECURRENCE_STATUS, $pts_args);
 }
 /**
  * @covers  \Importer\Service::proceedPost
  * @depends testCrawlFeed
  */
 public function testProceedPost()
 {
     include 'wp-loader.php';
     define('TEST_ENV', true);
     register_post_status('test', array('public' => false, 'exclude_from_search' => true, 'show_in_admin_all_list' => false, 'show_in_admin_status_list' => false));
     $importer = $this->createImporter();
     $feed = $this->testCrawlFeed();
     $data = array('feed' => 'testFeed', 'post' => $feed['data'][0]);
     $postId = $importer->proceedPost($data);
     $this->assertTrue($postId > 0);
     wp_delete_post($postId, true);
 }
 /**
  * Registers the 'patchchat' post type along with the 'new', 'open', and 'closed' statuses
  *
  * @author caseypatrickdriscoll
  *
  * @created 2015-07-18 15:04:14
  * @edited  2015-07-18 15:12:00 - Refactors to show in 'PatchChat' submenu
  * @edited  2015-07-18 16:20:09 - Refactors to use static statuses array
  *
  */
 public static function register_post_type()
 {
     // TODO: Remove patchchat comments from normal comments admin
     //   http://wordpress.stackexchange.com/questions/72210/exclude-post-type-from-admin-comments-list/72220#72220
     // TODO: Adjust query so comments appear on 'patchchat' cpt
     // TODO: Make 'Chats' appear in the admin menu bar
     register_post_type('patchchat', array('labels' => array('name' => __('Chats', 'patchworks'), 'singular_name' => __('Chat', 'patchworks'), 'all_items' => __('Chats', 'patchworks'), 'new_item' => __('New Chat', 'patchworks'), 'add_new' => __('Add New', 'patchworks'), 'add_new_item' => __('Add New Chat', 'patchworks'), 'edit_item' => __('Edit Chat', 'patchworks'), 'view_item' => __('View Chats', 'patchworks'), 'search_items' => __('Search Chats', 'patchworks'), 'not_found' => __('No Chats found', 'patchworks'), 'not_found_in_trash' => __('No Chats found in trash', 'patchworks'), 'parent_item_colon' => __('Parent Chat', 'patchworks'), 'menu_name' => __('Patchchats', 'patchworks')), 'public' => false, 'hierarchical' => false, 'show_ui' => true, 'show_in_menu' => false, 'show_in_nav_menus' => true, 'supports' => array('title', 'author', 'comments'), 'has_archive' => false, 'rewrite' => true, 'query_var' => true, 'menu_icon' => 'dashicons-format-chat'));
     // TODO: Decide to show 'closed' in 'All' view
     foreach (PatchChat::$statuses as $status) {
         register_post_status($status, array('label' => _x(ucfirst($status), 'patchworks'), 'public' => true, 'exclude_from_search' => true, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop(ucfirst($status) . ' <span class="count">(%s)</span>', ucfirst($status) . ' <span class="count">(%s)</span>')));
     }
 }
 /**
  * register_post_types function.
  */
 public function register_post_types()
 {
     if (post_type_exists("job_application")) {
         return;
     }
     $plural = __('Job Applications', 'wp-job-manager-applications');
     $singular = __('Application', 'wp-job-manager-applications');
     register_post_type("job_application", apply_filters("register_post_type_job_application", array('labels' => array('name' => $plural, 'singular_name' => $singular, 'menu_name' => $plural, 'all_items' => sprintf(__('All %s', 'wp-job-manager-applications'), $plural), 'add_new' => __('Add New', 'wp-job-manager-applications'), 'add_new_item' => sprintf(__('Add %s', 'wp-job-manager-applications'), $singular), 'edit' => __('Edit', 'wp-job-manager-applications'), 'edit_item' => sprintf(__('Edit %s', 'wp-job-manager-applications'), $singular), 'new_item' => sprintf(__('New %s', 'wp-job-manager-applications'), $singular), 'view' => sprintf(__('View %s', 'wp-job-manager-applications'), $singular), 'view_item' => sprintf(__('View %s', 'wp-job-manager-applications'), $singular), 'search_items' => sprintf(__('Search %s', 'wp-job-manager-applications'), $plural), 'not_found' => sprintf(__('No %s found', 'wp-job-manager-applications'), $plural), 'not_found_in_trash' => sprintf(__('No %s found in trash', 'wp-job-manager-applications'), $plural), 'parent' => sprintf(__('Parent %s', 'wp-job-manager-applications'), $singular)), 'description' => __('This is where you can edit and view applications.', 'wp-job-manager-applications'), 'public' => false, 'show_ui' => true, 'capability_type' => 'job_application', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title', 'custom-fields', 'editor'), 'has_archive' => false, 'show_in_nav_menus' => false)));
     $applicaton_statuses = get_job_application_statuses();
     foreach ($applicaton_statuses as $name => $label) {
         register_post_status($name, apply_filters('register_job_application_status', array('label' => $label, 'public' => true, 'exclude_from_search' => 'archived' === $name ? true : false, 'show_in_admin_all_list' => 'archived' === $name ? false : true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop($label . ' <span class="count">(%s)</span>', $label . ' <span class="count">(%s)</span>', 'wp-job-manager')), $name));
     }
 }
 function register_post_type()
 {
     $supports = apply_filters('wdsi-slide_in-post_type-supports', array('title', 'editor'));
     // Force required support
     if (!in_array('title', $supports)) {
         $supports[] = 'title';
     }
     if (!in_array('editor', $supports)) {
         $supports[] = 'editor';
     }
     register_post_type(self::POST_TYPE, array('labels' => array('name' => __('Slide In', 'wdsi'), 'singular_name' => __('Slide In Message', 'wdsi'), 'add_new_item' => __('Add new Slide In Message', 'wdsi'), 'edit_item' => __('Edit Slide In Message', 'wdsi')), 'menu_icon' => WDSI_PLUGIN_URL . '/img/admin-menu-icon.png', 'public' => false, 'show_ui' => true, 'supports' => $supports));
     register_post_status(self::NOT_IN_POOL_STATUS, array('protected' => true));
 }
 /**
  * Set an array of valid booking statuses and register any custom statuses
  * @since 0.0.1
  */
 public function set_booking_statuses()
 {
     $this->booking_statuses['pending'] = array('label' => _x('Pending', 'Booking status when it is pending review', RTB_TEXTDOMAIN), 'default' => true, 'user_selectable' => true);
     $this->booking_statuses['confirmed'] = array('label' => _x('Confirmed', 'Booking status for a confirmed booking', RTB_TEXTDOMAIN), 'default' => false, 'user_selectable' => true, 'public' => false, 'exclude_from_search' => true, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>', RTB_TEXTDOMAIN));
     $this->booking_statuses['closed'] = array('label' => _x('Closed', 'Booking status for a closed booking', RTB_TEXTDOMAIN), 'default' => false, 'user_selectable' => true, 'public' => false, 'exclude_from_search' => true, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Closed <span class="count">(%s)</span>', 'Closed <span class="count">(%s)</span>', RTB_TEXTDOMAIN));
     // Let addons hook in to add/edit/remove post statuses
     $this->booking_statuses = apply_filters('rtb_post_statuses_args', $this->booking_statuses);
     // Register the custom post statuses
     foreach ($this->booking_statuses as $status => $args) {
         if ($args['default'] === false) {
             register_post_status($status, $args);
         }
     }
 }
 /**
  * register_post_types function.
  *
  * @access public
  * @return void
  */
 public function register_post_types()
 {
     if (post_type_exists("job_listing")) {
         return;
     }
     $admin_capability = 'manage_job_listings';
     /**
      * Taxonomies
      */
     if (get_option('job_manager_enable_categories')) {
         $singular = __('Job Category', 'wp-job-manager');
         $plural = __('Job Categories', 'wp-job-manager');
         if (current_theme_supports('job-manager-templates')) {
             $rewrite = array('slug' => _x('job-category', 'Job category slug - resave permalinks after changing this', 'wp-job-manager'), 'with_front' => false, 'hierarchical' => false);
         } else {
             $rewrite = false;
         }
         register_taxonomy("job_listing_category", array("job_listing"), array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => $plural, 'labels' => array('name' => $plural, 'singular_name' => $singular, 'search_items' => sprintf(__('Search %s', 'wp-job-manager'), $plural), 'all_items' => sprintf(__('All %s', 'wp-job-manager'), $plural), 'parent_item' => sprintf(__('Parent %s', 'wp-job-manager'), $singular), 'parent_item_colon' => sprintf(__('Parent %s:', 'wp-job-manager'), $singular), 'edit_item' => sprintf(__('Edit %s', 'wp-job-manager'), $singular), 'update_item' => sprintf(__('Update %s', 'wp-job-manager'), $singular), 'add_new_item' => sprintf(__('Add New %s', 'wp-job-manager'), $singular), 'new_item_name' => sprintf(__('New %s Name', 'wp-job-manager'), $singular)), 'show_ui' => true, 'query_var' => true, 'capabilities' => array('manage_terms' => $admin_capability, 'edit_terms' => $admin_capability, 'delete_terms' => $admin_capability, 'assign_terms' => $admin_capability), 'rewrite' => $rewrite));
     }
     $singular = __('Job Type', 'wp-job-manager');
     $plural = __('Job Types', 'wp-job-manager');
     if (current_theme_supports('job-manager-templates')) {
         $rewrite = array('slug' => _x('job-type', 'Job type slug - resave permalinks after changing this', 'wp-job-manager'), 'with_front' => false, 'hierarchical' => false);
     } else {
         $rewrite = false;
     }
     register_taxonomy("job_listing_type", array("job_listing"), array('hierarchical' => true, 'label' => $plural, 'labels' => array('name' => $plural, 'singular_name' => $singular, 'search_items' => sprintf(__('Search %s', 'wp-job-manager'), $plural), 'all_items' => sprintf(__('All %s', 'wp-job-manager'), $plural), 'parent_item' => sprintf(__('Parent %s', 'wp-job-manager'), $singular), 'parent_item_colon' => sprintf(__('Parent %s:', 'wp-job-manager'), $singular), 'edit_item' => sprintf(__('Edit %s', 'wp-job-manager'), $singular), 'update_item' => sprintf(__('Update %s', 'wp-job-manager'), $singular), 'add_new_item' => sprintf(__('Add New %s', 'wp-job-manager'), $singular), 'new_item_name' => sprintf(__('New %s Name', 'wp-job-manager'), $singular)), 'show_ui' => true, 'query_var' => true, 'capabilities' => array('manage_terms' => $admin_capability, 'edit_terms' => $admin_capability, 'delete_terms' => $admin_capability, 'assign_terms' => $admin_capability), 'rewrite' => $rewrite));
     /**
      * Post types
      */
     $singular = __('Job Listing', 'wp-job-manager');
     $plural = __('Job Listings', 'wp-job-manager');
     if (current_theme_supports('job-manager-templates')) {
         $has_archive = _x('jobs', 'Post type archive slug - resave permalinks after changing this', 'wp-job-manager');
     } else {
         $has_archive = false;
     }
     $rewrite = array('slug' => _x('job', 'Job permalink - resave permalinks after changing this', 'wp-job-manager'), 'with_front' => false, 'feeds' => true, 'pages' => false);
     register_post_type("job_listing", apply_filters("register_post_type_job_listing", array('labels' => array('name' => $plural, 'singular_name' => $singular, 'menu_name' => $plural, 'all_items' => sprintf(__('All %s', 'wp-job-manager'), $plural), 'add_new' => __('Add New', 'wp-job-manager'), 'add_new_item' => sprintf(__('Add %s', 'wp-job-manager'), $singular), 'edit' => __('Edit', 'wp-job-manager'), 'edit_item' => sprintf(__('Edit %s', 'wp-job-manager'), $singular), 'new_item' => sprintf(__('New %s', 'wp-job-manager'), $singular), 'view' => sprintf(__('View %s', 'wp-job-manager'), $singular), 'view_item' => sprintf(__('View %s', 'wp-job-manager'), $singular), 'search_items' => sprintf(__('Search %s', 'wp-job-manager'), $plural), 'not_found' => sprintf(__('No %s found', 'wp-job-manager'), $plural), 'not_found_in_trash' => sprintf(__('No %s found in trash', 'wp-job-manager'), $plural), 'parent' => sprintf(__('Parent %s', 'wp-job-manager'), $singular)), 'description' => __('This is where you can create and manage job listings.', 'wp-job-manager'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'capabilities' => array('publish_posts' => $admin_capability, 'edit_posts' => $admin_capability, 'edit_others_posts' => $admin_capability, 'delete_posts' => $admin_capability, 'delete_others_posts' => $admin_capability, 'read_private_posts' => $admin_capability, 'edit_post' => $admin_capability, 'delete_post' => $admin_capability, 'read_post' => 'read_job_listing'), 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => $rewrite, 'query_var' => true, 'supports' => array('title', 'editor', 'custom-fields'), 'has_archive' => $has_archive, 'show_in_nav_menus' => false)));
     /**
      * Feeds
      */
     add_feed('job_feed', array($this, 'job_feed'));
     /**
      * Post status
      */
     register_post_status('expired', array('label' => _x('Expired', 'job_listing', 'wp-job-manager'), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Expired <span class="count">(%s)</span>', 'Expired <span class="count">(%s)</span>', 'wp-job-manager')));
     register_post_status('preview', array('public' => false, 'exclude_from_search' => true, 'show_in_admin_all_list' => false, 'show_in_admin_status_list' => false));
 }
Example #29
0
function adext_payments_init()
{
    $args = array('labels' => array(), 'public' => false, 'show_ui' => false, 'supports' => array('title'), 'has_archive' => false);
    register_post_type('adverts-pricing', apply_filters('adverts_post_type', $args, 'adverts-pricing'));
    $args = array('labels' => array(), 'public' => false, 'show_ui' => false, 'supports' => array('title'), 'has_archive' => false);
    register_post_type('adverts-payment', apply_filters('adverts_post_type', $args, 'adverts-payment'));
    register_post_status('completed', array('label' => _x('Completed', 'completed status payment', 'adverts'), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Unread <span class="count">(%s)</span>', 'Unread <span class="count">(%s)</span>', 'adverts')));
    register_post_status('failed', array('label' => _x('Failed', 'failed status payment', 'adverts'), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'adverts')));
    register_post_status('pending', array('label' => _x('Pending', 'pending status payment', 'adverts'), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>', 'adverts')));
    register_post_status('refunded', array('label' => _x('Refunded', 'refunded status payment', 'adverts'), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'adverts')));
    register_post_status('advert-pending', array('label' => _x('Pending', 'post'), 'public' => is_admin() || current_user_can("edit_pages"), 'label_count' => _n_noop('Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>', 'adverts')));
    adverts_form_add_field('adverts_field_listing_type', array(''));
    add_action("adverts_install_module_payments", "adext_payments_install");
    add_filter("adverts_form_load", "adext_payments_form_load");
}
Example #30
0
/**
 * Creates the initial post types when 'init' action is fired.
 *
 * @since 2.9.0
 */
function create_initial_post_types()
{
    register_post_type('post', array('public' => true, '_builtin' => true, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats')));
    register_post_type('page', array('public' => true, '_builtin' => true, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'page', 'map_meta_cap' => true, 'hierarchical' => true, 'rewrite' => false, 'query_var' => false, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions')));
    register_post_type('attachment', array('labels' => array('name' => __('Media')), 'public' => true, 'show_ui' => false, '_builtin' => true, '_edit_link' => 'media.php?attachment_id=%d', 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'show_in_nav_menus' => false));
    register_post_type('revision', array('labels' => array('name' => __('Revisions'), 'singular_name' => __('Revision')), 'public' => false, '_builtin' => true, '_edit_link' => 'revision.php?revision=%d', 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'can_export' => false));
    register_post_type('nav_menu_item', array('labels' => array('name' => __('Navigation Menu Items'), 'singular_name' => __('Navigation Menu Item')), 'public' => false, '_builtin' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false));
    register_post_status('publish', array('label' => _x('Published', 'post'), 'public' => true, '_builtin' => true, 'label_count' => _n_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>')));
    register_post_status('future', array('label' => _x('Scheduled', 'post'), 'protected' => true, '_builtin' => true, 'label_count' => _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>')));
    register_post_status('draft', array('label' => _x('Draft', 'post'), 'protected' => true, '_builtin' => true, 'label_count' => _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')));
    register_post_status('pending', array('label' => _x('Pending', 'post'), 'protected' => true, '_builtin' => true, 'label_count' => _n_noop('Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>')));
    register_post_status('private', array('label' => _x('Private', 'post'), 'private' => true, '_builtin' => true, 'label_count' => _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')));
    register_post_status('trash', array('label' => _x('Trash', 'post'), 'internal' => true, '_builtin' => true, 'label_count' => _n_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>'), 'show_in_admin_status_list' => true));
    register_post_status('auto-draft', array('label' => 'auto-draft', 'internal' => true, '_builtin' => true));
    register_post_status('inherit', array('label' => 'inherit', 'internal' => true, '_builtin' => true, 'exclude_from_search' => false));
}