Exemplo n.º 1
0
 protected function __construct()
 {
     parent::__construct();
     // Customize post manager columns
     add_filter(sprintf('manage_edit-%s_columns', static::SLUG), [$this, 'setPostTableColumns']);
     add_filter(sprintf('manage_edit-%s_sortable_columns', static::SLUG), [$this, 'setSortableColumns']);
     add_action(sprintf('manage_%s_posts_custom_column', static::SLUG), [$this, 'renderColumn']);
     // Handle custom post manager ordering
     add_filter('posts_join_paged', [$this, 'getJoinSql'], 10, 2);
     add_filter('posts_orderby', [$this, 'getOrderBySql'], 10, 2);
 }
 protected function __construct()
 {
     parent::__construct();
     add_filter('wp_insert_post_data', [$this, 'syncTitle'], 100, 2);
     add_filter(sprintf('manage_edit-%s_columns', static::SLUG), [$this, 'setPostTableColumns']);
 }