| 1 |
<?php |
| 2 |
/** |
| 3 |
* The main class for Meta-box configurations. |
| 4 |
* |
| 5 |
* @package Smart_Post_Show |
| 6 |
* @subpackage Smart_Post_Show/admin/views |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
die; } // Cannot access pages directly. |
| 11 |
|
| 12 |
/** |
| 13 |
* Smart Post Show Metaboxes. |
| 14 |
*/ |
| 15 |
class SPS_Metaboxes { |
| 16 |
|
| 17 |
/** |
| 18 |
* Layout Metabox function. |
| 19 |
* |
| 20 |
* @param string $prefix The meta-key for this metabox. |
| 21 |
* @return void |
| 22 |
*/ |
| 23 |
public static function layout_metabox( $prefix ) { |
| 24 |
SP_PC::createMetabox( |
| 25 |
$prefix, |
| 26 |
array( |
| 27 |
'title' => __( 'Smart Post Show', 'smart-post-show' ), |
| 28 |
'post_type' => 'sp_post_carousel', |
| 29 |
'show_restore' => false, |
| 30 |
'context' => 'normal', |
| 31 |
) |
| 32 |
); |
| 33 |
|
| 34 |
SPS_Layout::section( $prefix ); |
| 35 |
|
| 36 |
} |
| 37 |
/** |
| 38 |
* Preview metabox. |
| 39 |
* |
| 40 |
* @param string $prefix The metabox main Key. |
| 41 |
* @return void |
| 42 |
*/ |
| 43 |
public static function preview_metabox( $prefix ) { |
| 44 |
SP_PC::createMetabox( |
| 45 |
$prefix, |
| 46 |
array( |
| 47 |
'title' => __( 'Live Preview', 'smart-post-show' ), |
| 48 |
'post_type' => 'sp_post_carousel', |
| 49 |
'show_restore' => false, |
| 50 |
'context' => 'normal', |
| 51 |
) |
| 52 |
); |
| 53 |
SP_PC::createSection( |
| 54 |
$prefix, |
| 55 |
array( |
| 56 |
'fields' => array( |
| 57 |
array( |
| 58 |
'type' => 'preview', |
| 59 |
), |
| 60 |
), |
| 61 |
) |
| 62 |
); |
| 63 |
} |
| 64 |
/** |
| 65 |
* Option Metabox function |
| 66 |
* |
| 67 |
* @param string $prefix The metabox key. |
| 68 |
* @return void |
| 69 |
*/ |
| 70 |
public static function option_metabox( $prefix ) { |
| 71 |
SP_PC::createMetabox( |
| 72 |
$prefix, |
| 73 |
array( |
| 74 |
'title' => __( 'View Options', 'smart-post-show' ), |
| 75 |
'post_type' => 'sp_post_carousel', |
| 76 |
'show_restore' => false, |
| 77 |
'theme' => 'light', |
| 78 |
) |
| 79 |
); |
| 80 |
|
| 81 |
SPS_FilterPost::section( $prefix ); |
| 82 |
SPS_Display::section( $prefix ); |
| 83 |
SPS_Carousel::section( $prefix ); |
| 84 |
SPS_DetailSettings::section( $prefix ); |
| 85 |
SPS_Typography::section( $prefix ); |
| 86 |
} |
| 87 |
/** |
| 88 |
* Shortcode Metabox function |
| 89 |
* |
| 90 |
* @param string $prefix The metabox key. |
| 91 |
* @return void |
| 92 |
*/ |
| 93 |
public static function shortcode_metabox( $prefix ) { |
| 94 |
SP_PC::createMetabox( |
| 95 |
$prefix, |
| 96 |
array( |
| 97 |
'title' => __( 'How To Use', 'smart-post-show' ), |
| 98 |
'post_type' => 'sp_post_carousel', |
| 99 |
'context' => 'side', |
| 100 |
'show_restore' => false, |
| 101 |
) |
| 102 |
); |
| 103 |
|
| 104 |
SPS_Shortcode::section( $prefix ); |
| 105 |
|
| 106 |
} |
| 107 |
|
| 108 |
} |
| 109 |
|