| 1 |
<?php |
| 2 |
namespace Elementor\Modules\Campaigns; |
| 3 |
|
| 4 |
use Elementor\Core\Base\Module as BaseModule; |
| 5 |
use Elementor\Modules\LandingPages\Module as Landing_Page_Module; |
| 6 |
use Elementor\Plugin; |
| 7 |
use Elementor\TemplateLibrary\Source_Local; |
| 8 |
use Elementor\Utils; |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; // Exit if accessed directly. |
| 12 |
} |
| 13 |
|
| 14 |
/** |
| 15 |
* Campaigns Module |
| 16 |
* |
| 17 |
* 'e-campaigns' is a custom taxonomy that is associated with Popups, Landing Pages, and Form Submissions. |
| 18 |
*/ |
| 19 |
class Module extends BaseModule { |
| 20 |
|
| 21 |
const TAXONOMY_NAME = 'e-campaigns'; |
| 22 |
|
| 23 |
public function get_name() { |
| 24 |
return 'campaigns'; |
| 25 |
} |
| 26 |
|
| 27 |
private function register_campaigns_taxonomy() { |
| 28 |
$taxonomy_labels = [ |
| 29 |
'name' => _x( 'Campaigns', 'Campaigns taxonomy general name', 'elementor' ), |
| 30 |
'singular_name' => _x( 'Campaign', 'Campaign singular name', 'elementor' ), |
| 31 |
'search_items' => __( 'Search Campaigns', 'elementor' ), |
| 32 |
'popular_items' => __( 'Popular Campaigns', 'elementor' ), |
| 33 |
'all_items' => __( 'All Campaigns', 'elementor' ), |
| 34 |
'edit_item' => __( 'Edit Campaign', 'elementor' ), |
| 35 |
'update_item' => __( 'Update Campaign', 'elementor' ), |
| 36 |
'add_new_item' => __( 'Add New Campaign', 'elementor' ), |
| 37 |
'new_item_name' => __( 'New Campaign Name', 'elementor' ), |
| 38 |
'separate_items_with_commas' => __( 'Separate Campaigns with commas', 'elementor' ), |
| 39 |
'add_or_remove_items' => __( 'Add or remove Campaigns', 'elementor' ), |
| 40 |
'choose_from_most_used' => __( 'Choose from the most used Campaigns', 'elementor' ), |
| 41 |
'not_found' => __( 'No Campaigns found.', 'elementor' ), |
| 42 |
'menu_name' => __( 'Campaigns', 'elementor' ), |
| 43 |
]; |
| 44 |
|
| 45 |
$taxonomy_args = [ |
| 46 |
'labels' => $taxonomy_labels, |
| 47 |
'public' => false, |
| 48 |
'meta_box_cb' => false, // Don't show metabox. |
| 49 |
'show_in_quick_edit' => false, |
| 50 |
'query_var' => is_admin(), |
| 51 |
'rewrite' => false, |
| 52 |
]; |
| 53 |
|
| 54 |
register_taxonomy( self::TAXONOMY_NAME, Source_Local::CPT, $taxonomy_args ); |
| 55 |
} |
| 56 |
|
| 57 |
public function __construct() { |
| 58 |
$this->register_campaigns_taxonomy(); |
| 59 |
} |
| 60 |
} |
| 61 |
|