Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Dashboard\CPS\wp_custom_post_status ;
- /**
- * Description of ArchivePostStatus
- *
- * @author ahmedali
- */
- class oldPostStatus extends wp_custom_post_status {
- /**
- * @access protected
- * @var string
- */
- static protected $instance;
- /**
- * Creates a new instance. Called on 'after_setup_theme'.
- * May be used to access class methods from outside.
- *
- * @return void
- */
- static public function init()
- {
- null === self :: $instance and self :: $instance = new self;
- return self :: $instance;
- }
- public function __construct()
- {
- // Set your data here. Only "$post_status" is required.
- $this->post_status = 'old';
- // The post types where you want to add the custom status. Allowed are string and array
- $this->post_type = [ "post" ];
- // @see parent class: defaults inside add_post_status()
- $this->args = array();
- parent :: __construct();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement