| @@ -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; |
| @@ -235,9 +232,8 @@ | ||
| 235 | 232 | ]; |
| 236 | 233 | } |
| 237 | 234 | |
| 238 | 235 | $this->builder::$views->get( 'builder/tabs', [ 'tabs' => $tabs, 'template_types' => $template_types ] ); |
| 239 | - return []; | |
| 240 | 236 | } |
| 241 | 237 | |
| 242 | 238 | /** |
| 243 | 239 | * Retrieves items. |