| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Templately\Builder; |
| 4 | 4 | |
| 5 | +use Templately\Core\Importer\FullSiteImport; | |
| 5 | 6 | use Templately\Utils\Helper; |
| 6 | 7 | use WP_Post; |
| 7 | 8 | use WP_Query; |
| 8 | 9 | |
| @@ -25,9 +26,9 @@ | ||
| 25 | 26 | $this->register_post_type(); |
| 26 | 27 | } |
| 27 | 28 | |
| 28 | 29 | private function add_actions() { |
| 29 | - add_filter( 'views_edit-' . self::CPT, [ $this, 'admin_print_tabs' ] ); | |
| 30 | + add_filter( 'views_edit-' . self::CPT, [ $this, 'admin_print_tabs' ], 100 ); | |
| 30 | 31 | add_action( 'in_admin_header', [ $this, 'in_admin_header' ] ); |
| 31 | 32 | if ( is_admin() ) { |
| 32 | 33 | // add_action( 'manage_posts_extra_tablenav', [ $this, 'extra_table_nav' ] ); |
| 33 | 34 | add_action( 'manage_' . self::CPT . '_posts_custom_column', [ $this, 'custom_column' ], 10, 2 ); |
| @@ -215,8 +216,9 @@ | ||
| 215 | 216 | $types = templately()->theme_builder::$templates_manager->get_template_types(); |
| 216 | 217 | |
| 217 | 218 | $template_types = []; |
| 218 | 219 | $status_args = [ 'post_type' => 'templately_library' ]; |
| 220 | + $has_revert = FullSiteImport::has_revert(); | |
| 219 | 221 | |
| 220 | 222 | $template_types['all'] = [ |
| 221 | 223 | 'url' => add_query_arg( $status_args, 'edit.php' ), |
| 222 | 224 | 'label' => __( 'All', 'templately' ) |
| @@ -233,9 +235,16 @@ | ||
| 233 | 235 | 'label' => call_user_func( [ $type, 'get_title' ] ) |
| 234 | 236 | ]; |
| 235 | 237 | } |
| 236 | 238 | |
| 237 | - $this->builder::$views->get( 'builder/tabs', [ 'tabs' => $tabs, 'template_types' => $template_types ] ); | |
| 239 | + $status_args['type'] = 'settings'; | |
| 240 | + $template_types['settings'] = [ | |
| 241 | + 'url' => add_query_arg( $status_args, 'edit.php' ), | |
| 242 | + 'label' => __( 'Miscellaneous', 'templately' ) | |
| 243 | + ]; | |
| 244 | + | |
| 245 | + $this->builder::$views->get( 'builder/tabs', [ 'tabs' => $tabs, 'template_types' => $template_types, 'has_revert' => $has_revert ] ); | |
| 246 | + return []; | |
| 238 | 247 | } |
| 239 | 248 | |
| 240 | 249 | /** |
| 241 | 250 | * Retrieves items. |