| 1 |
<?php |
| 2 |
// Exit if accessed directly. |
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
/* |
| 7 |
Creating Meta boxes for timeline stories section |
| 8 |
*/ |
| 9 |
// Control core classes for avoid errors |
| 10 |
if ( class_exists( 'CSF' ) ) { |
| 11 |
|
| 12 |
// Set a unique slug-like ID |
| 13 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 14 |
$prefix = 'ctl_post_meta'; |
| 15 |
|
| 16 |
// |
| 17 |
// Create a metabox |
| 18 |
CSF::createMetabox( |
| 19 |
$prefix, |
| 20 |
array( |
| 21 |
'title' => 'Timeline Story Settings', |
| 22 |
'post_type' => 'cool_timeline', |
| 23 |
'data_type' => 'unserialize', |
| 24 |
'context' => 'normal', // The context within the screen where the boxes should display. `normal`, `side`, `advanced` |
| 25 |
) |
| 26 |
); |
| 27 |
|
| 28 |
// Create a section |
| 29 |
CSF::createSection( |
| 30 |
$prefix, |
| 31 |
array( |
| 32 |
// 'title' => 'Add Icon', |
| 33 |
'data_type' => 'unserialize', |
| 34 |
'fields' => array( |
| 35 |
|
| 36 |
// Story Date |
| 37 |
array( |
| 38 |
'id' => 'story_type', |
| 39 |
'type' => 'fieldset', |
| 40 |
'title' => 'Story Type', |
| 41 |
'fields' => array( |
| 42 |
array( |
| 43 |
'id' => 'ctl_story_date', |
| 44 |
'type' => 'datetime', |
| 45 |
'title' => __( 'Story Date / Year <span class="ctl_required">*</span>', 'cool-timeline' ), |
| 46 |
'desc' => '<p class="ctl_required">Please select story Story Date / Year / Time using datepicker only. <strong>Date Format( mm/dd/yy hh:mm )</strong></p>', |
| 47 |
'default' => gmdate( 'm/d/Y h:i a' ), |
| 48 |
'settings' => array( |
| 49 |
'enableTime' => true, |
| 50 |
'dateFormat' => 'm/d/Y h:i K', |
| 51 |
'minuteIncrement' => '1', |
| 52 |
), |
| 53 |
), |
| 54 |
), |
| 55 |
), |
| 56 |
|
| 57 |
// ICON |
| 58 |
array( |
| 59 |
'id' => 'story_icon', |
| 60 |
'type' => 'fieldset', |
| 61 |
'title' => 'Story Icon', |
| 62 |
'fields' => array( |
| 63 |
array( |
| 64 |
'id' => 'fa_field_icon', |
| 65 |
'type' => 'icon', |
| 66 |
'title' => 'Font Awesome Icon', |
| 67 |
), |
| 68 |
), |
| 69 |
), |
| 70 |
|
| 71 |
array( |
| 72 |
'id' => 'story_media', |
| 73 |
'type' => 'fieldset', |
| 74 |
'title' => 'Story Media', |
| 75 |
'fields' => array( |
| 76 |
array( |
| 77 |
'id' => 'img_cont_size', |
| 78 |
'type' => 'button_set', |
| 79 |
'title' => 'Story image size', |
| 80 |
'options' => array( |
| 81 |
'full' => 'Full', |
| 82 |
'small' => 'Small', |
| 83 |
), |
| 84 |
'default' => 'full', |
| 85 |
), |
| 86 |
|
| 87 |
|
| 88 |
), |
| 89 |
), |
| 90 |
|
| 91 |
array( |
| 92 |
'id' => 'ctl_pro_screenshot', |
| 93 |
'type' => 'content', |
| 94 |
'content' => '<div class="desc-field"><h4 >Premium Settings | <a target="_blank" href="' . esc_url( CTL_BUY_PRO . '?utm_source=ctl_plugin&utm_medium=inside&utm_campaign=get_pro&utm_content=add_stories' ) . '">Buy Pro</a></h4><a target="_blank" href="' . esc_url( CTL_BUY_PRO . '?utm_source=ctl_plugin&utm_medium=inside&utm_campaign=get_pro&utm_content=add_stories' ) . '"><img src="' . esc_url(CTL_PLUGIN_URL . '/assets/images/pro-story-settings.png' ) . '" style="max-width: 100%;border: 2px solid #ef2e2e;"></a></div>', |
| 95 |
'class' => 'story_format_image', |
| 96 |
), |
| 97 |
|
| 98 |
|
| 99 |
), |
| 100 |
|
| 101 |
) |
| 102 |
); |
| 103 |
|
| 104 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 105 |
$pro_list = 'feautre_list'; |
| 106 |
// Create a metabox |
| 107 |
CSF::createMetabox( |
| 108 |
$pro_list, |
| 109 |
array( |
| 110 |
'title' => '<span style="display:flex;gap:6px;align-items:flex-start;"><span aria-hidden="true">⭐</span><span>Cool Timeline Pro</span></span>', |
| 111 |
'post_type' => 'cool_timeline', |
| 112 |
'priority' => 'low', |
| 113 |
'data_type' => 'unserialize', |
| 114 |
'context' => 'side', // The context within the screen where the boxes should display. `normal`, `side`, `advanced` |
| 115 |
) |
| 116 |
); |
| 117 |
|
| 118 |
// Create a section |
| 119 |
CSF::createSection( |
| 120 |
$pro_list, |
| 121 |
array( |
| 122 |
// 'title' => 'Add Icon', |
| 123 |
'fields' => array( |
| 124 |
array( |
| 125 |
'id' => 'pro_feature_list_section', |
| 126 |
'type' => 'content', |
| 127 |
'content' => '<p style="margin:0 0 10px;">' . esc_html__( 'Create timelines your visitors will love.', 'cool-timeline' ) . '</p> |
| 128 |
<strong style="display:flex;gap:6px;align-items:flex-start;margin:0 0 8px;"><span aria-hidden="true">🔓</span><span>' . esc_html__( 'Unlock Premium Features', 'cool-timeline' ) . '</span></strong> |
| 129 |
<ul style="list-style:none;margin:2px 0 0;padding:0;"> |
| 130 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( '25+ Beautiful Timeline Designs', 'cool-timeline' ) . '</span></li> |
| 131 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Add Image Galleries & Videos', 'cool-timeline' ) . '</span></li> |
| 132 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Timeline Filters', 'cool-timeline' ) . '</span></li> |
| 133 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'AJAX Load More & Pagination', 'cool-timeline' ) . '</span></li> |
| 134 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Multiple Timeline Layouts', 'cool-timeline' ) . '</span></li> |
| 135 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Customize Colors & Typography', 'cool-timeline' ) . '</span></li> |
| 136 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Advanced Animations', 'cool-timeline' ) . '</span></li> |
| 137 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Horizontal & Vertical Timelines', 'cool-timeline' ) . '</span></li> |
| 138 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Gutenberg / Shortcode Generator & WPBakery Support', 'cool-timeline' ) . '</span></li> |
| 139 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Custom Story Styling', 'cool-timeline' ) . '</span></li> |
| 140 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Flexible Date Formats & Sorting', 'cool-timeline' ) . '</span></li> |
| 141 |
<li style="display:flex;gap:6px;align-items:flex-start;margin:0 0 4px;"><span aria-hidden="true">✓</span><span>' . esc_html__( 'Premium Support & Regular Updates', 'cool-timeline' ) . '</span></li> |
| 142 |
</ul>', |
| 143 |
'class' => 'pro_features', |
| 144 |
), |
| 145 |
array( |
| 146 |
'id' => 'pro_buy_links', |
| 147 |
'type' => 'content', |
| 148 |
'content' => '<div> |
| 149 |
<strong class="ctl_add_head">' . __( 'Upgrade to Pro version', 'cool-timeline' ) . '</strong> |
| 150 |
</br> |
| 151 |
</br> |
| 152 |
<a target="_blank" class="button button-primary" href="' . esc_url( CTL_DEMO_URL . '&utm_content=add_stories' ) . '"> |
| 153 |
View Demos |
| 154 |
</a> |
| 155 |
<a style="background:#CD143B;font-weight:bold" target="_blank" class="button button-primary" href="' . esc_url( CTL_BUY_PRO . '?utm_source=ctl_plugin&utm_medium=inside&utm_campaign=get_pro&utm_content=add_stories' ) . '"> |
| 156 |
Buy Now |
| 157 |
</a> |
| 158 |
</div>', |
| 159 |
'class' => 'pro_features', |
| 160 |
), |
| 161 |
|
| 162 |
), |
| 163 |
) |
| 164 |
); |
| 165 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 166 |
$review_us = 'review_us'; |
| 167 |
// Create a metabox |
| 168 |
CSF::createMetabox( |
| 169 |
$review_us, |
| 170 |
array( |
| 171 |
'title' => 'Please Share Your Feedback', |
| 172 |
'post_type' => 'cool_timeline', |
| 173 |
'data_type' => 'unserialize', |
| 174 |
'priority' => 'low', |
| 175 |
'context' => 'side', // The context within the screen where the boxes should display. `normal`, `side`, `advanced` |
| 176 |
) |
| 177 |
); |
| 178 |
|
| 179 |
// Create a section |
| 180 |
CSF::createSection( |
| 181 |
$review_us, |
| 182 |
array( |
| 183 |
'fields' => array( |
| 184 |
array( |
| 185 |
'id' => 'review_us_section', |
| 186 |
'type' => 'content', |
| 187 |
'content' => '<div>' . |
| 188 |
__( 'If you find our plugin and support helpful.<br>Please rate and review us,It helps us grow <br>and improve our services', 'cool-timeline' ) . '.<br> |
| 189 |
<a target="_blank" href="https://wordpress.org/support/plugin/cool-timeline/reviews/#new-post"><img src="' . esc_url(CTL_PLUGIN_URL . 'assets/images/stars5.png' ) . '"></a><br> |
| 190 |
<a class="button button-primary" target="_blank" href="https://wordpress.org/support/plugin/cool-timeline/reviews/#new-post">' . __( 'Submit Review � |
| 191 |
� |
| 192 |
� |
| 193 |
� |
| 194 |
� |
| 195 |
', 'cool-timeline' ) . '</a> |
| 196 |
</div>', |
| 197 |
'class' => 'pro_features', |
| 198 |
), |
| 199 |
), |
| 200 |
) |
| 201 |
); |
| 202 |
|
| 203 |
} |
| 204 |
|
| 205 |
|