| @@ -1,9 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | + exit; // Exit if accessed directly. | |
| 4 | +} | |
| 2 | 5 | /** |
| 3 | 6 | * Fired during plugin activation |
| 4 | 7 | * |
| 5 | - * @link https://wpsmartpost.com/ | |
| 8 | + * @link https://smartpostshow.com/ | |
| 6 | 9 | * @since 2.2.0 |
| 7 | 10 | * |
| 8 | 11 | * @package Smart_Post_Show |
| 9 | 12 | * @subpackage Smart_Post_Show/includes |
| @@ -8,11 +11,8 @@ | ||
| 8 | 11 | * @package Smart_Post_Show |
| 9 | 12 | * @subpackage Smart_Post_Show/includes |
| 10 | 13 | */ |
| 11 | 14 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | - exit; // Exit if accessed directly. | |
| 14 | -} | |
| 15 | 15 | /** |
| 16 | 16 | * Custom post class to register the carousel. |
| 17 | 17 | */ |
| 18 | 18 | class Smart_Post_Show_Post_Type { |
| @@ -64,49 +64,39 @@ | ||
| 64 | 64 | if ( post_type_exists( 'sp_post_carousel' ) ) { |
| 65 | 65 | return; |
| 66 | 66 | } |
| 67 | 67 | $capability = sp_pc_dashboard_capability(); |
| 68 | - $show_ui = current_user_can( $capability ) ? true : false; | |
| 69 | - | |
| 70 | 68 | // Set the Smart post show post type labels. |
| 71 | 69 | $labels = apply_filters( |
| 72 | 70 | 'sp_post_carousel_post_type_labels', |
| 73 | 71 | array( |
| 74 | - 'name' => __( 'Manage Shows', 'post-carousel' ), | |
| 75 | - 'singular_name' => __( 'Show', 'post-carousel' ), | |
| 76 | - 'menu_name' => __( 'Smart Post', 'post-carousel' ), | |
| 77 | - 'all_items' => __( 'Manage Shows', 'post-carousel' ), | |
| 78 | - 'add_new' => __( 'Add New', 'post-carousel' ), | |
| 79 | - 'add_new_item' => __( 'Add New Show', 'post-carousel' ), | |
| 80 | - 'edit' => __( 'Edit', 'post-carousel' ), | |
| 81 | - 'edit_item' => __( 'Edit Show', 'post-carousel' ), | |
| 82 | - 'new_item' => __( 'New Show', 'post-carousel' ), | |
| 83 | - 'search_items' => __( 'Search Shows', 'post-carousel' ), | |
| 84 | - 'not_found' => __( 'No Shows found', 'post-carousel' ), | |
| 85 | - 'not_found_in_trash' => __( 'No Shows found in Trash', 'post-carousel' ), | |
| 86 | - 'parent' => __( 'Parent Show', 'post-carousel' ), | |
| 72 | + 'name' => __( 'Manage Shows', 'smart-post-show' ), | |
| 73 | + 'singular_name' => __( 'Show', 'smart-post-show' ), | |
| 74 | + 'menu_name' => __( 'Smart Post Show', 'smart-post-show' ), | |
| 75 | + 'all_items' => __( 'Manage Shows', 'smart-post-show' ), | |
| 76 | + 'add_new' => __( 'Add New', 'smart-post-show' ), | |
| 77 | + 'add_new_item' => __( 'Add New Show', 'smart-post-show' ), | |
| 78 | + 'edit' => __( 'Edit', 'smart-post-show' ), | |
| 79 | + 'edit_item' => __( 'Edit Show', 'smart-post-show' ), | |
| 80 | + 'new_item' => __( 'New Show', 'smart-post-show' ), | |
| 81 | + 'search_items' => __( 'Search Shows', 'smart-post-show' ), | |
| 82 | + 'not_found' => __( 'No Shows found', 'smart-post-show' ), | |
| 83 | + 'not_found_in_trash' => __( 'No Shows found in Trash', 'smart-post-show' ), | |
| 84 | + 'parent' => __( 'Parent Show', 'smart-post-show' ), | |
| 87 | 85 | ) |
| 88 | 86 | ); |
| 89 | 87 | // Set the Smart post show post type arguments. |
| 90 | 88 | $menu_icon = 'data:image/svg+xml;base64,' . base64_encode( |
| 91 | - '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
| 92 | - <path d="M1.25 12.2422C1.25 11.4871 1.8621 10.875 2.61715 10.875H7.75765C8.51271 10.875 9.12481 11.4871 9.12481 12.2422V17.3828C9.12481 18.1379 8.51271 18.75 7.75765 18.75H2.61715C1.8621 18.75 1.25 18.1379 1.25 17.3828V12.2422Z" fill="white"/> | |
| 93 | - <path d="M10.8748 5.1875C10.8748 3.01288 12.6376 1.25 14.8122 1.25C16.9867 1.25 18.7496 3.01288 18.7496 5.1875C18.7496 7.36212 16.9867 9.125 14.8122 9.125C12.6376 9.125 10.8748 7.36212 10.8748 5.1875Z" fill="white"/> | |
| 94 | - <path d="M1.25 2.61719C1.25 1.86211 1.8621 1.25 2.61715 1.25H7.75765C8.51271 1.25 9.12481 1.86211 9.12481 2.61719V7.75781C9.12481 8.51289 8.51271 9.125 7.75765 9.125H2.61715C1.8621 9.125 1.25 8.51289 1.25 7.75781V2.61719Z" fill="white"/> | |
| 95 | - <rect x="10.8752" y="16.9999" width="7.87481" height="1.16667" rx="0.583333" fill="white"/> | |
| 96 | - <rect x="10.8752" y="11.458" width="7.87481" height="1.16667" rx="0.583333" fill="white"/> | |
| 97 | - <rect x="10.8752" y="14.0829" width="7.87481" height="1.16667" rx="0.583333" fill="white"/> | |
| 98 | - </svg>' | |
| 89 | + '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 288 288" enable-background="new 0 0 288 288" xml:space="preserve"><path fill="#A0A5AA" d="M262.102,20.977H27.615c-3.195,0-6.638,2.401-6.638,5.63v234.359c0,3.229,3.443,6.057,6.638,6.057h234.487c3.187,0,4.921-2.828,4.921-6.057V26.607C267.023,23.378,265.289,20.977,262.102,20.977z M118.37,53.441h51.26v43.571h-51.26V53.441z M55.15,53.441h51.26v43.571H55.15V53.441z M135.457,235.413H55.15v-46.134h80.307V235.413z M135.457,173.047H55.15v-46.134h80.307V173.047z M235.413,235.413h-80.307v-46.134h80.307V235.413z M235.413,173.047h-80.307v-46.134h80.307V173.047z M235.413,97.012h-51.26V53.441h51.26V97.012z"/><line fill="none" x1="-99" y1="-84" x2="-99" y2="-57"/><line fill="none" x1="-170" y1="61" x2="-170" y2="101"/></svg>' | |
| 99 | 90 | ); |
| 100 | 91 | $args = apply_filters( |
| 101 | 92 | 'sp_post_carousel_post_type_args', |
| 102 | 93 | array( |
| 103 | - 'label' => __( 'Manage Shows', 'post-carousel' ), | |
| 104 | - 'description' => __( 'Manage Shows', 'post-carousel' ), | |
| 94 | + 'label' => __( 'Manage Shows', 'smart-post-show' ), | |
| 95 | + 'description' => __( 'Manage Shows', 'smart-post-show' ), | |
| 105 | 96 | 'public' => false, |
| 106 | - 'show_ui' => $show_ui, | |
| 107 | - 'show_in_menu' => $show_ui, | |
| 108 | - 'show_in_rest' => true, | |
| 97 | + 'show_ui' => true, | |
| 98 | + 'show_in_menu' => true, | |
| 109 | 99 | 'menu_icon' => $menu_icon, |
| 110 | 100 | 'hierarchical' => false, |
| 111 | 101 | 'query_var' => false, |
| 112 | 102 | 'menu_position' => 5, |
| @@ -122,8 +112,9 @@ | ||
| 122 | 112 | 'delete_post' => $capability, |
| 123 | 113 | 'read_post' => $capability, |
| 124 | 114 | ), |
| 125 | 115 | 'capability_type' => 'post', |
| 116 | + // 'rewrite' => true, | |
| 126 | 117 | 'labels' => $labels, |
| 127 | 118 | ) |
| 128 | 119 | ); |
| 129 | 120 | |