| @@ -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 ); |
| @@ -35,9 +36,9 @@ | ||
| 35 | 36 | add_filter( 'post_row_actions', [ $this, 'post_row_actions' ], 10, 2 ); |
| 36 | 37 | add_action( 'admin_footer', [ $this, 'app' ] ); |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | - add_action( 'save_post', [ $this, 'save_post' ], 11, 3 ); | |
| 40 | + // add_action( 'save_post', [ $this, 'save_post' ], 11, 3 ); | |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | /** |
| 43 | 44 | * If needed to add a filter for platform |
| @@ -69,9 +70,11 @@ | ||
| 69 | 70 | switch ( $column_name ) { |
| 70 | 71 | case 'template_type': |
| 71 | 72 | $types = $this->builder::$templates_manager->get_template_types(); |
| 72 | 73 | $type = get_post_meta( $post_id, self::TYPE_META_KEY, true ); |
| 73 | - echo call_user_func( [ $types[ $type ], 'get_title' ] ); | |
| 74 | + if(isset($types[ $type ])){ | |
| 75 | + echo call_user_func( [ $types[ $type ], 'get_title' ] ); | |
| 76 | + } | |
| 74 | 77 | break; |
| 75 | 78 | case 'template_platform': |
| 76 | 79 | echo get_post_meta( $post_id, self::PLATFORM_META_KEY, true ); |
| 77 | 80 | break; |
| @@ -232,8 +235,9 @@ | ||
| 232 | 235 | ]; |
| 233 | 236 | } |
| 234 | 237 | |
| 235 | 238 | $this->builder::$views->get( 'builder/tabs', [ 'tabs' => $tabs, 'template_types' => $template_types ] ); |
| 239 | + return []; | |
| 236 | 240 | } |
| 237 | 241 | |
| 238 | 242 | /** |
| 239 | 243 | * Retrieves items. |