| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) exit; // if direct access |
| 3 |
//remove_filter('post_grid_settings_tabs', 'post_grid_pro_settings_tabs', 90); |
| 4 |
//remove_action('post_grid_settings_content_license', 'post_grid_settings_content_license', 10); |
| 5 |
//remove_action('post_grid_settings_save', 'post_grid_pro_settings_save'); |
| 6 |
add_action('post_grid_settings_content_general', 'post_grid_settings_content_general'); |
| 7 |
function post_grid_settings_content_general() |
| 8 |
{ |
| 9 |
$settings_tabs_field = new settings_tabs_field(); |
| 10 |
$post_grid_settings = get_option('post_grid_settings'); |
| 11 |
$font_aw_version = isset($post_grid_settings['font_aw_version']) ? $post_grid_settings['font_aw_version'] : 'none'; |
| 12 |
$post_grid_preview = isset($post_grid_settings['post_grid_preview']) ? $post_grid_settings['post_grid_preview'] : 'yes'; |
| 13 |
$post_options_post_types = isset($post_grid_settings['post_options_post_types']) ? $post_grid_settings['post_options_post_types'] : array(); |
| 14 |
$posttypes_array = post_grid_posttypes_array(); |
| 15 |
?> |
| 16 |
<div class="section"> |
| 17 |
<div class="section-title"><?php echo esc_html__('General', 'post-grid'); ?></div> |
| 18 |
<p class="description section-description"><?php echo esc_html__('Choose some general options.', 'post-grid'); ?></p> |
| 19 |
<?php |
| 20 |
$args = array( |
| 21 |
'id' => 'post_options_post_types', |
| 22 |
'parent' => 'post_grid_settings', |
| 23 |
'title' => esc_html__('Post option by post types', 'post-grid'), |
| 24 |
'details' => esc_html__('Enable post options for selected post types', 'post-grid'), |
| 25 |
'type' => 'select', |
| 26 |
'value' => $post_options_post_types, |
| 27 |
'default' => array(), |
| 28 |
'multiple' => true, |
| 29 |
'args' => $posttypes_array, |
| 30 |
); |
| 31 |
$settings_tabs_field->generate_field($args); |
| 32 |
$args = array( |
| 33 |
'id' => 'font_aw_version', |
| 34 |
'parent' => 'post_grid_settings', |
| 35 |
'title' => esc_html__('Font-awesome version', 'post-grid'), |
| 36 |
'details' => esc_html__('Choose font awesome version you want to load.', 'post-grid'), |
| 37 |
'type' => 'select', |
| 38 |
'value' => $font_aw_version, |
| 39 |
'default' => '', |
| 40 |
'args' => array('v_5' => esc_html__('Version 5+', 'post-grid'), 'v_4' => esc_html__('Version 4+', 'post-grid'), 'none' => esc_html__('None', 'post-grid')), |
| 41 |
); |
| 42 |
$settings_tabs_field->generate_field($args); |
| 43 |
$args = array( |
| 44 |
'id' => 'post_grid_preview', |
| 45 |
'parent' => 'post_grid_settings', |
| 46 |
'title' => esc_html__('Enable post grid preview', 'post-grid'), |
| 47 |
'details' => esc_html__('You can enable preview post grid.', 'post-grid'), |
| 48 |
'type' => 'select', |
| 49 |
'value' => $post_grid_preview, |
| 50 |
'default' => 'yes', |
| 51 |
'args' => array('yes' => esc_html__('Yes', 'post-grid'), 'no' => esc_html__('No', 'post-grid')), |
| 52 |
); |
| 53 |
$settings_tabs_field->generate_field($args); |
| 54 |
?> |
| 55 |
</div> |
| 56 |
<?php |
| 57 |
} |
| 58 |
add_action('post_grid_settings_content_help_support', 'post_grid_settings_content_help_support'); |
| 59 |
if (!function_exists('post_grid_settings_content_help_support')) { |
| 60 |
function post_grid_settings_content_help_support($tab) |
| 61 |
{ |
| 62 |
$settings_tabs_field = new settings_tabs_field(); |
| 63 |
$layouts_pro_url = ''; |
| 64 |
$layouts_pro_url_json = ''; |
| 65 |
if (is_plugin_active('post-grid-pro/post-grid-pro.php')) { |
| 66 |
$layouts_pro_url = post_grid_pro_plugin_url . 'sample-data/post-grid-layouts.xml'; |
| 67 |
$layouts_pro_url_json = post_grid_pro_plugin_url . 'sample-data/post-grid-layouts.json'; |
| 68 |
} |
| 69 |
$layouts_free_url = post_grid_plugin_url . 'sample-data/post-grid-layouts.xml'; |
| 70 |
$layouts_free_url_json = post_grid_plugin_url . 'sample-data/post-grid-layouts.json'; |
| 71 |
?> |
| 72 |
<div class="section"> |
| 73 |
<div class="section-title"><?php echo esc_html__('Get support', 'post-grid'); ?></div> |
| 74 |
<p class="description section-description"> |
| 75 |
<?php echo esc_html__('Use following to get help and support from our expert team.', 'post-grid'); ?></p> |
| 76 |
<?php |
| 77 |
ob_start(); |
| 78 |
?> |
| 79 |
<ul> |
| 80 |
<li>Step - 1: Go to Tools > <a href="<?php echo esc_url(admin_url() . 'export.php'); ?>">Export</a> menu.</li> |
| 81 |
<li>Step - 2: Choose "Layouts" post types from list.</li> |
| 82 |
<li>Step - 3: Then click to "Download Export File' button.</li> |
| 83 |
<li>Step - 4: Save the file on your local machine.</li> |
| 84 |
</ul> |
| 85 |
<?php |
| 86 |
$html = ob_get_clean(); |
| 87 |
$args = array( |
| 88 |
'id' => 'export_layouts', |
| 89 |
//'parent' => '', |
| 90 |
'title' => esc_html__('Export layouts', 'post-grid'), |
| 91 |
'details' => '', |
| 92 |
'type' => 'custom_html', |
| 93 |
'html' => $html, |
| 94 |
); |
| 95 |
$settings_tabs_field->generate_field($args); |
| 96 |
ob_start(); |
| 97 |
?> |
| 98 |
<p> |
| 99 |
<?php echo esc_html__('Ask question for free on our forum and get quick reply from our expert team members.', 'post-grid'); ?> |
| 100 |
</p> |
| 101 |
<a class="button" |
| 102 |
href="https://www.pickplugins.com/create-support-ticket/"><?php echo esc_html__('Create support ticket', 'post-grid'); ?></a> |
| 103 |
<p><?php echo esc_html__('Read our documentation before asking your question.', 'post-grid'); ?></p> |
| 104 |
<a class="button" href="https://comboblocks.com/documentations/"><?php echo esc_html__('Documentation', 'post-grid'); ?></a> |
| 105 |
<p><?php echo esc_html__('Watch video tutorials.', 'post-grid'); ?></p> |
| 106 |
<a class="button" href="https://www.youtube.com/playlist?list=PL0QP7T2SN94Yut5Y0MSVg1wqmqWz0UYpt"><i |
| 107 |
class="fab fa-youtube"></i> <?php echo esc_html__('All tutorials', 'post-grid'); ?></a> |
| 108 |
<?php |
| 109 |
$html = ob_get_clean(); |
| 110 |
$args = array( |
| 111 |
'id' => 'get_support', |
| 112 |
//'parent' => '', |
| 113 |
'title' => esc_html__('Ask question', 'post-grid'), |
| 114 |
'details' => '', |
| 115 |
'type' => 'custom_html', |
| 116 |
'html' => $html, |
| 117 |
); |
| 118 |
$settings_tabs_field->generate_field($args); |
| 119 |
ob_start(); |
| 120 |
?> |
| 121 |
<p class="">We wish your 2 minutes to write your feedback about the <b>Post Grid</b> plugin. give us <span |
| 122 |
style="color: #ffae19"><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i |
| 123 |
class="fas fa-star"></i><i class="fas fa-star"></i></span></p> |
| 124 |
<a target="_blank" href="https://wordpress.org/support/plugin/post-grid/reviews/#new-post" class="button"><i |
| 125 |
class="fab fa-wordpress"></i> Write a review</a> |
| 126 |
<?php |
| 127 |
$html = ob_get_clean(); |
| 128 |
$args = array( |
| 129 |
'id' => 'reviews', |
| 130 |
//'parent' => '', |
| 131 |
'title' => esc_html__('Submit reviews', 'post-grid'), |
| 132 |
'details' => '', |
| 133 |
'type' => 'custom_html', |
| 134 |
'html' => $html, |
| 135 |
); |
| 136 |
$settings_tabs_field->generate_field($args); |
| 137 |
?> |
| 138 |
</div> |
| 139 |
<?php |
| 140 |
} |
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
add_action('post_grid_settings_save', 'post_grid_settings_save'); |
| 146 |
function post_grid_settings_save() |
| 147 |
{ |
| 148 |
$post_grid_settings = isset($_POST['post_grid_settings']) ? post_grid_recursive_sanitize_arr(wp_unslash($_POST['post_grid_settings'])) : array(); |
| 149 |
update_option('post_grid_settings', $post_grid_settings); |
| 150 |
$post_grid_license = isset($_POST['post_grid_license']) ? post_grid_recursive_sanitize_arr(wp_unslash($_POST['post_grid_license'])) : array(); |
| 151 |
update_option('post_grid_license', $post_grid_license); |
| 152 |
} |
| 153 |
|