Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <?php
  2. use Dashboard\CPS\wp_custom_post_status ;
  3.  
  4. /**
  5. * Description of ArchivePostStatus
  6. *
  7. * @author ahmedali
  8. */
  9.  
  10. class oldPostStatus extends wp_custom_post_status {
  11. /**
  12. * @access protected
  13. * @var string
  14. */
  15. static protected $instance;
  16. /**
  17. * Creates a new instance. Called on 'after_setup_theme'.
  18. * May be used to access class methods from outside.
  19. *
  20. * @return void
  21. */
  22. static public function init()
  23. {
  24. null === self :: $instance and self :: $instance = new self;
  25. return self :: $instance;
  26. }
  27. public function __construct()
  28. {
  29. // Set your data here. Only "$post_status" is required.
  30. $this->post_status = 'old';
  31. // The post types where you want to add the custom status. Allowed are string and array
  32. $this->post_type = [ "post" ];
  33. // @see parent class: defaults inside add_post_status()
  34. $this->args = array();
  35. parent :: __construct();
  36. }
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement