| @@ -1,9 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Templately\Builder; |
| 4 | 4 | |
| 5 | -use Templately\Core\Importer\FullSiteImport; | |
| 6 | 5 | use Templately\Utils\Helper; |
| 7 | 6 | use WP_Post; |
| 8 | 7 | use WP_Query; |
| 9 | 8 | |
| @@ -26,9 +25,9 @@ | ||
| 26 | 25 | $this->register_post_type(); |
| 27 | 26 | } |
| 28 | 27 | |
| 29 | 28 | private function add_actions() { |
| 30 | - add_filter( 'views_edit-' . self::CPT, [ $this, 'admin_print_tabs' ], 100 ); | |
| 29 | + add_filter( 'views_edit-' . self::CPT, [ $this, 'admin_print_tabs' ] ); | |
| 31 | 30 | add_action( 'in_admin_header', [ $this, 'in_admin_header' ] ); |
| 32 | 31 | if ( is_admin() ) { |
| 33 | 32 | // add_action( 'manage_posts_extra_tablenav', [ $this, 'extra_table_nav' ] ); |
| 34 | 33 | add_action( 'manage_' . self::CPT . '_posts_custom_column', [ $this, 'custom_column' ], 10, 2 ); |
| @@ -36,9 +35,9 @@ | ||
| 36 | 35 | add_filter( 'post_row_actions', [ $this, 'post_row_actions' ], 10, 2 ); |
| 37 | 36 | add_action( 'admin_footer', [ $this, 'app' ] ); |
| 38 | 37 | } |
| 39 | 38 | |
| 40 | - // add_action( 'save_post', [ $this, 'save_post' ], 11, 3 ); | |
| 39 | + add_action( 'save_post', [ $this, 'save_post' ], 11, 3 ); | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | /** |
| 44 | 43 | * If needed to add a filter for platform |
| @@ -70,11 +69,9 @@ | ||
| 70 | 69 | switch ( $column_name ) { |
| 71 | 70 | case 'template_type': |
| 72 | 71 | $types = $this->builder::$templates_manager->get_template_types(); |
| 73 | 72 | $type = get_post_meta( $post_id, self::TYPE_META_KEY, true ); |
| 74 | - if(isset($types[ $type ])){ | |
| 75 | - echo call_user_func( [ $types[ $type ], 'get_title' ] ); | |
| 76 | - } | |
| 73 | + echo call_user_func( [ $types[ $type ], 'get_title' ] ); | |
| 77 | 74 | break; |
| 78 | 75 | case 'template_platform': |
| 79 | 76 | echo get_post_meta( $post_id, self::PLATFORM_META_KEY, true ); |
| 80 | 77 | break; |
| @@ -216,9 +213,8 @@ | ||
| 216 | 213 | $types = templately()->theme_builder::$templates_manager->get_template_types(); |
| 217 | 214 | |
| 218 | 215 | $template_types = []; |
| 219 | 216 | $status_args = [ 'post_type' => 'templately_library' ]; |
| 220 | - $has_revert = FullSiteImport::has_revert(); | |
| 221 | 217 | |
| 222 | 218 | $template_types['all'] = [ |
| 223 | 219 | 'url' => add_query_arg( $status_args, 'edit.php' ), |
| 224 | 220 | 'label' => __( 'All', 'templately' ) |
| @@ -235,16 +231,9 @@ | ||
| 235 | 231 | 'label' => call_user_func( [ $type, 'get_title' ] ) |
| 236 | 232 | ]; |
| 237 | 233 | } |
| 238 | 234 | |
| 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 []; | |
| 235 | + $this->builder::$views->get( 'builder/tabs', [ 'tabs' => $tabs, 'template_types' => $template_types ] ); | |
| 247 | 236 | } |
| 248 | 237 | |
| 249 | 238 | /** |
| 250 | 239 | * Retrieves items. |