| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FireBox |
| 4 | - * @version 1.1.0 Free | |
| 4 | + * @version 3.1.14 Free | |
| 5 | 5 | * |
| 6 | 6 | * @author FirePlugins <[email protected]> |
| 7 | 7 | * @link https://www.fireplugins.com |
| 8 | - * @copyright Copyright © 2022 FirePlugins All Rights Reserved | |
| 8 | + * @copyright Copyright © 2026 FirePlugins All Rights Reserved | |
| 9 | 9 | * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | namespace FireBox\Core\Admin\Includes; |
| @@ -22,14 +22,8 @@ | ||
| 22 | 22 | { |
| 23 | 23 | parent::__construct($this->getLibrarySettings()); |
| 24 | 24 | |
| 25 | 25 | add_action('current_screen', [$this, 'validate']); |
| 26 | - | |
| 27 | - // set default post title | |
| 28 | - add_filter('default_title', [$this, 'presetPostTitle'], 100, 2); | |
| 29 | - | |
| 30 | - // set default post content | |
| 31 | - add_filter('default_content', [$this, 'presetPostContent'], 200, 2); | |
| 32 | 26 | } |
| 33 | 27 | |
| 34 | 28 | /** |
| 35 | 29 | * Returns the library settings. |
| @@ -39,11 +33,11 @@ | ||
| 39 | 33 | private function getLibrarySettings() |
| 40 | 34 | { |
| 41 | 35 | return [ |
| 42 | 36 | 'id' => 'fbSelectTemplate', |
| 43 | - 'title' => 'FB_POPUP_LIBRARY', | |
| 37 | + 'title' => firebox()->_('FB_CAMPAIGN_LIBRARY'), | |
| 44 | 38 | 'create_new_template_link' => admin_url('post-new.php?post_type=firebox'), |
| 45 | - 'main_category_label' => firebox()->_('FB_POPUP_TYPE'), | |
| 39 | + 'main_category_label' => firebox()->_('FB_CAMPAIGN_TYPE'), | |
| 46 | 40 | 'plugin_license_settings_url' => admin_url('admin.php?page=firebox-settings#license_key'), |
| 47 | 41 | 'plugin_dir' => FBOX_PLUGIN_DIR, |
| 48 | 42 | 'plugin' => 'firebox', |
| 49 | 43 | 'plugin_version' => FBOX_VERSION, |
| @@ -49,10 +43,14 @@ | ||
| 49 | 43 | 'plugin_version' => FBOX_VERSION, |
| 50 | 44 | 'plugin_license_type' => FBOX_LICENSE_TYPE, |
| 51 | 45 | 'plugin_name' => firebox()->_('FB_PLUGIN_NAME'), |
| 52 | 46 | |
| 53 | - 'blank_template_label' => firebox()->_('FB_BLANK_POPUP'), | |
| 54 | - 'template_use_url' => 'post-new.php?post_type=firebox&fpf_use_template=true&template=' | |
| 47 | + 'license_key' => false, | |
| 48 | + 'license_key_status' => false, | |
| 49 | + | |
| 50 | + | |
| 51 | + 'blank_template_label' => fpframework()->_('FPF_BLANK_TEMPLATE'), | |
| 52 | + 'template_use_url' => 'post.php?action=edit&post=' | |
| 55 | 53 | ]; |
| 56 | 54 | } |
| 57 | 55 | |
| 58 | 56 | /** |
| @@ -79,8 +77,12 @@ | ||
| 79 | 77 | $current_screen = get_current_screen(); |
| 80 | 78 | |
| 81 | 79 | $allowed_pages = [ |
| 82 | 80 | 'toplevel_page_firebox', |
| 81 | + 'firebox_page_firebox-analytics', | |
| 82 | + 'firebox_page_firebox-campaigns', | |
| 83 | + 'firebox_page_firebox-submissions', | |
| 84 | + 'firebox_page_firebox-settings', | |
| 83 | 85 | 'edit-firebox' |
| 84 | 86 | ]; |
| 85 | 87 | |
| 86 | 88 | if (!in_array($current_screen->id, $allowed_pages)) |
| @@ -88,41 +90,6 @@ | ||
| 88 | 90 | return false; |
| 89 | 91 | } |
| 90 | 92 | |
| 91 | 93 | $this->init(); |
| 92 | - } | |
| 93 | - | |
| 94 | - /** | |
| 95 | - * Set the default post title if we have selected a template via the Library | |
| 96 | - * | |
| 97 | - * @param string $post_title | |
| 98 | - * @param object $post | |
| 99 | - * | |
| 100 | - * @return string | |
| 101 | - */ | |
| 102 | - public function presetPostTitle($post_title, $post) | |
| 103 | - { | |
| 104 | - if (!$template = \FireBox\Core\Helpers\BoxHelper::getBoxFromTemplateURL()) | |
| 105 | - { | |
| 106 | - return; | |
| 107 | - } | |
| 108 | - | |
| 109 | - return $template['template']['post_title']; | |
| 110 | - } | |
| 111 | - | |
| 112 | - /** | |
| 113 | - * Sets the default post content if we have selected a template via the Library | |
| 114 | - * | |
| 115 | - * @param string | |
| 116 | - * | |
| 117 | - * @return string | |
| 118 | - */ | |
| 119 | - public function presetPostContent($content) | |
| 120 | - { | |
| 121 | - if (!$template = \FireBox\Core\Helpers\BoxHelper::getBoxFromTemplateURL()) | |
| 122 | - { | |
| 123 | - return; | |
| 124 | - } | |
| 125 | - | |
| 126 | - return $template['template']['post_content']; | |
| 127 | 94 | } |
| 128 | 95 | } |