mirror of
https://github.com/proelements/proelements.git
synced 2026-04-05 20:13:47 +00:00
v3.35.0
This commit is contained in:
@@ -10,23 +10,23 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Custom_Fonts_Menu_Item implements Admin_Menu_Item {
|
||||
public function get_capability() {
|
||||
public function get_capability(): string {
|
||||
return Fonts_Manager::CAPABILITY;
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Custom Fonts', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Settings::PAGE_ID;
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
public function get_position(): ?int {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function is_visible() {
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,15 +10,15 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Custom_Fonts_Promotion_Menu_Item extends Base_Promotion_Item {
|
||||
public function get_name() {
|
||||
public function get_name(): string {
|
||||
return 'custom-fonts-promotion';
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
public function get_position(): ?int {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get_cta_url() {
|
||||
public function get_cta_url(): string {
|
||||
$connect_url = Plugin::instance()->license_admin->get_connect_url( [
|
||||
'utm_source' => 'wp-custom-fonts',
|
||||
'utm_medium' => 'wp-dash',
|
||||
@@ -32,25 +32,25 @@ class Custom_Fonts_Promotion_Menu_Item extends Base_Promotion_Item {
|
||||
: $connect_url;
|
||||
}
|
||||
|
||||
public function get_cta_text() {
|
||||
public function get_cta_text(): string {
|
||||
return API::is_license_expired()
|
||||
? esc_html__( 'Renew now', 'elementor-pro' )
|
||||
: esc_html__( 'Connect & Activate', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Custom Fonts', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_page_title() {
|
||||
public function get_page_title(): string {
|
||||
return esc_html__( 'Custom Fonts', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_promotion_title() {
|
||||
public function get_promotion_title(): string {
|
||||
return esc_html__( 'Add Your Custom Fonts', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_promotion_description() {
|
||||
public function get_promotion_description(): string {
|
||||
return esc_html__(
|
||||
'Custom Fonts allows you to add your self-hosted fonts and use them on your projects to create a unique brand language.',
|
||||
'elementor-pro'
|
||||
|
||||
@@ -10,23 +10,23 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Custom_Icons_Menu_Item implements Admin_Menu_Item {
|
||||
public function get_capability() {
|
||||
public function get_capability(): string {
|
||||
return Icons_Manager::CAPABILITY;
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Custom Icons', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Settings::PAGE_ID;
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
public function get_position(): ?int {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function is_visible() {
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Custom_Icons_Promotion_Menu_Item extends Base_Promotion_Item {
|
||||
public function get_name() {
|
||||
public function get_name(): string {
|
||||
return 'custom-icons-promotion';
|
||||
}
|
||||
|
||||
public function get_cta_url() {
|
||||
public function get_cta_url(): string {
|
||||
$connect_url = Plugin::instance()->license_admin->get_connect_url( [
|
||||
'utm_source' => 'wp-custom-icons',
|
||||
'utm_medium' => 'wp-dash',
|
||||
@@ -28,29 +28,29 @@ class Custom_Icons_Promotion_Menu_Item extends Base_Promotion_Item {
|
||||
: $connect_url;
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
public function get_position(): ?int {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get_cta_text() {
|
||||
public function get_cta_text(): string {
|
||||
return API::is_license_expired()
|
||||
? esc_html__( 'Renew now', 'elementor-pro' )
|
||||
: esc_html__( 'Connect & Activate', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Custom Icons', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_page_title() {
|
||||
public function get_page_title(): string {
|
||||
return esc_html__( 'Custom Icons', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_promotion_title() {
|
||||
public function get_promotion_title(): string {
|
||||
return esc_html__( 'Add Your Custom Icons', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_promotion_description() {
|
||||
public function get_promotion_description(): string {
|
||||
return esc_html__(
|
||||
'Don\'t rely solely on the FontAwesome icons everyone else is using! Differentiate your website and your style with custom icons you can upload from your favorite icons source.',
|
||||
'elementor-pro'
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AssetsManager\AssetTypes\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\AdminMenuItems\Custom_Fonts_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\Fonts_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Fonts_Menu_Item extends Custom_Fonts_Menu_Item implements Menu_Item_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Fonts_Manager::MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Fonts', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::CUSTOM_ELEMENTS_GROUP_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AssetsManager\AssetTypes\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\AdminMenuItems\Custom_Fonts_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\Fonts_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Fonts_Promotion extends Custom_Fonts_Promotion_Menu_Item implements Menu_Item_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Fonts_Manager::PROMOTION_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Fonts', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::CUSTOM_ELEMENTS_GROUP_ID;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AssetsManager\AssetTypes\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\AdminMenuItems\Custom_Icons_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\Icons_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Icons_Menu_Item extends Custom_Icons_Menu_Item implements Menu_Item_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Icons_Manager::MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Icons', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::CUSTOM_ELEMENTS_GROUP_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AssetsManager\AssetTypes\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\AdminMenuItems\Custom_Icons_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\Icons_Manager;
|
||||
|
||||
class Editor_One_Icons_Promotion extends Custom_Icons_Promotion_Menu_Item implements Menu_Item_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Icons_Manager::PROMOTION_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Icons', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::CUSTOM_ELEMENTS_GROUP_ID;
|
||||
}
|
||||
}
|
||||
@@ -2,21 +2,27 @@
|
||||
namespace ElementorPro\Modules\AssetsManager\AssetTypes;
|
||||
|
||||
use Elementor\Core\Admin\Menu\Admin_Menu_Manager;
|
||||
use Elementor\Utils;
|
||||
use ElementorPro\Core\Utils as Pro_Utils;
|
||||
use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
|
||||
use Elementor\Plugin;
|
||||
use Elementor\Settings;
|
||||
use Elementor\Utils;
|
||||
use ElementorPro\Base\Editor_One_Trait;
|
||||
use ElementorPro\Core\Behaviors\Feature_Lock;
|
||||
use ElementorPro\Core\Utils as Pro_Utils;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\AdminMenuItems\Custom_Fonts_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\AdminMenuItems\Custom_Fonts_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\EditorOneMenuItems\Editor_One_Fonts_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\EditorOneMenuItems\Editor_One_Fonts_Promotion;
|
||||
use ElementorPro\Modules\AssetsManager\Classes;
|
||||
use Elementor\Settings;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Fonts_Manager {
|
||||
use Editor_One_Trait;
|
||||
|
||||
const CAPABILITY = 'manage_options';
|
||||
|
||||
@@ -612,9 +618,6 @@ class Fonts_Manager {
|
||||
return $parent_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Font Manager action and filter hooks
|
||||
*/
|
||||
protected function actions() {
|
||||
add_action( 'init', [ $this, 'register_post_type_and_tax' ] );
|
||||
|
||||
@@ -622,6 +625,10 @@ class Fonts_Manager {
|
||||
add_action( 'init', [ $this, 'redirect_admin_old_page_to_new' ] );
|
||||
|
||||
add_action( 'elementor/admin/menu/register', function ( Admin_Menu_Manager $admin_menu_manager ) {
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->register_admin_menu( $admin_menu_manager );
|
||||
} );
|
||||
|
||||
@@ -643,6 +650,14 @@ class Fonts_Manager {
|
||||
}, 50 );
|
||||
|
||||
add_action( 'admin_head', [ $this, 'clean_admin_listing_page' ] );
|
||||
|
||||
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
|
||||
if ( $this->can_use_custom_fonts() ) {
|
||||
$menu_data_provider->register_menu( new Editor_One_Fonts_Menu_Item() );
|
||||
} else {
|
||||
$menu_data_provider->register_menu( new Editor_One_Fonts_Promotion() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
// TODO: Maybe just ignore all of those when the user can't use custom fonts?
|
||||
@@ -667,6 +682,12 @@ class Fonts_Manager {
|
||||
// Ajax.
|
||||
add_action( 'elementor/ajax/register_actions', [ $this, 'register_ajax_actions' ] );
|
||||
|
||||
add_filter( 'elementor/editor-one/admin-edit-post-types', function ( array $post_types ) {
|
||||
$post_types[] = self::CPT;
|
||||
|
||||
return $post_types;
|
||||
} );
|
||||
|
||||
/**
|
||||
* Elementor fonts manager loaded.
|
||||
*
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
namespace ElementorPro\Modules\AssetsManager\AssetTypes;
|
||||
|
||||
use Elementor\Core\Admin\Menu\Admin_Menu_Manager;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
|
||||
use Elementor\Plugin;
|
||||
use ElementorPro\Base\Editor_One_Trait;
|
||||
use ElementorPro\Core\Behaviors\Feature_Lock;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\AdminMenuItems\Custom_Icons_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\AdminMenuItems\Custom_Icons_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\EditorOneMenuItems\Editor_One_Icons_Menu_Item;
|
||||
use ElementorPro\Modules\AssetsManager\AssetTypes\EditorOneMenuItems\Editor_One_Icons_Promotion;
|
||||
use ElementorPro\Modules\AssetsManager\Classes;
|
||||
use Elementor\Settings;
|
||||
|
||||
@@ -14,6 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Icons_Manager {
|
||||
use Editor_One_Trait;
|
||||
|
||||
const CAPABILITY = 'manage_options';
|
||||
|
||||
@@ -193,9 +199,6 @@ class Icons_Manager {
|
||||
return $categories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Font Manager action and filter hooks
|
||||
*/
|
||||
protected function actions() {
|
||||
add_action( 'init', [ $this, 'register_post_type' ] );
|
||||
|
||||
@@ -203,6 +206,10 @@ class Icons_Manager {
|
||||
add_action( 'init', [ $this, 'redirect_admin_old_page_to_new' ] );
|
||||
|
||||
add_action( 'elementor/admin/menu/register', function ( Admin_Menu_Manager $admin_menu_manager ) {
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->register_admin_menu( $admin_menu_manager );
|
||||
} );
|
||||
|
||||
@@ -224,6 +231,14 @@ class Icons_Manager {
|
||||
}, 50 );
|
||||
|
||||
add_action( 'admin_head', [ $this, 'clean_admin_listing_page' ] );
|
||||
|
||||
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
|
||||
if ( $this->can_use_custom_icons() ) {
|
||||
$menu_data_provider->register_menu( new Editor_One_Icons_Menu_Item() );
|
||||
} else {
|
||||
$menu_data_provider->register_menu( new Editor_One_Icons_Promotion() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
// TODO: Maybe just ignore all of those when the user can't use custom icons?
|
||||
@@ -232,6 +247,12 @@ class Icons_Manager {
|
||||
|
||||
add_filter( 'elementor/finder/categories', [ $this, 'add_finder_item' ] );
|
||||
|
||||
add_filter( 'elementor/editor-one/admin-edit-post-types', function ( array $post_types ) {
|
||||
$post_types[] = self::CPT;
|
||||
|
||||
return $post_types;
|
||||
} );
|
||||
|
||||
/**
|
||||
* Elementor icons manager loaded.
|
||||
*
|
||||
|
||||
68
modules/atomic-form/module.php
Normal file
68
modules/atomic-form/module.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\AtomicForm;
|
||||
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\Plugin;
|
||||
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
|
||||
use Elementor\Core\Experiments\Manager as ExperimentsManager;
|
||||
use ElementorPro\Modules\AtomicForm\Widgets\Input;
|
||||
use ElementorPro\Modules\AtomicForm\Widgets\Label;
|
||||
use ElementorPro\Modules\AtomicForm\Widgets\Textarea;
|
||||
use Elementor\Widgets_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
const MODULE_NAME = 'e-atomic-form';
|
||||
const EXPERIMENT_NAME = 'e_pro_atomic_form';
|
||||
|
||||
public function get_name() {
|
||||
return self::MODULE_NAME;
|
||||
}
|
||||
|
||||
public static function get_experimental_data(): array {
|
||||
return [
|
||||
'name' => self::EXPERIMENT_NAME,
|
||||
'title' => esc_html__( 'Atomic Form', 'elementor-pro' ),
|
||||
'description' => esc_html__( 'Atomic form widgets. Note: This feature requires the "Atomic Widgets" experiment to be enabled.', 'elementor-pro' ),
|
||||
'hidden' => true,
|
||||
'default' => ExperimentsManager::STATE_INACTIVE,
|
||||
'release_status' => ExperimentsManager::RELEASE_STATUS_DEV,
|
||||
];
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
if ( ! $this->is_experiment_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_filter(
|
||||
'elementor/widgets/register',
|
||||
fn( $widgets_manager ) => $this->register_widgets( $widgets_manager )
|
||||
);
|
||||
|
||||
add_action( 'elementor/frontend/after_enqueue_styles', fn () => $this->add_inline_styles() );
|
||||
}
|
||||
|
||||
private function is_experiment_active(): bool {
|
||||
return Plugin::elementor()->experiments->is_feature_active( self::EXPERIMENT_NAME )
|
||||
&& Plugin::elementor()->experiments->is_feature_active( AtomicWidgetsModule::EXPERIMENT_NAME );
|
||||
}
|
||||
|
||||
private function register_widgets( Widgets_Manager $widgets_manager ) {
|
||||
$widgets_manager->register( new Input() );
|
||||
$widgets_manager->register( new Label() );
|
||||
$widgets_manager->register( new Textarea() );
|
||||
}
|
||||
|
||||
private function add_inline_styles() {
|
||||
// Default html textarea is resizable, but Elementor Atomic textarea is not resizable by default
|
||||
$inline_css = '.e-form-textarea-base:not([data-resizable]) { resize: none; }';
|
||||
wp_add_inline_style( 'elementor-frontend', $inline_css );
|
||||
}
|
||||
|
||||
}
|
||||
20
modules/atomic-form/templates/input.html.twig
Normal file
20
modules/atomic-form/templates/input.html.twig
Normal file
@@ -0,0 +1,20 @@
|
||||
{% set classes = settings.classes | merge( [ base_styles.base ] ) | join(' ') | trim %}
|
||||
{% set id_attribute = settings._cssid is not empty ? 'id=' ~ settings._cssid | e('html_attr') : '' %}
|
||||
{% set interactions_attribute = interactions is not empty ? 'data-interactions=' ~ interactions | json_encode | e('html_attr') : '' %}
|
||||
{% set placeholder_attribute = settings.placeholder is not empty ? 'placeholder=' ~ settings.placeholder | e('html_attr') : '' %}
|
||||
{% set required_attribute = settings.required ? 'required' : '' %}
|
||||
{% set readonly_attribute = settings.readonly ? 'readonly' : '' %}
|
||||
{% set name = settings.name is not empty ? settings.name : settings._cssid is not empty ? settings._cssid : id %}
|
||||
{% set name_attribute = 'name=' ~ name | e('html_attr') %}
|
||||
<input
|
||||
{{ id_attribute }}
|
||||
{{ name_attribute }}
|
||||
class="{{ classes }}"
|
||||
type="{{ settings.type }}"
|
||||
data-interaction-id="{{ id }}"
|
||||
{{ settings.attributes | raw }}
|
||||
{{ interactions_attribute }}
|
||||
{{ placeholder_attribute }}
|
||||
{{ required_attribute }}
|
||||
{{ readonly_attribute }}
|
||||
/>
|
||||
13
modules/atomic-form/templates/label.html.twig
Normal file
13
modules/atomic-form/templates/label.html.twig
Normal file
@@ -0,0 +1,13 @@
|
||||
{% set classes = settings.classes | merge( [ base_styles.base ] ) | join(' ') | trim %}
|
||||
{% set id_attribute = settings._cssid is not empty ? 'id=' ~ settings._cssid | e('html_attr') : '' %}
|
||||
{% set for_attribute = settings['input-id'] is not empty ? 'for=' ~ settings['input-id'] | e('html_attr') : '' %}
|
||||
{% set interactions_attribute = interactions is not empty ? 'data-interactions=' ~ interactions | json_encode | e('html_attr') : '' %}
|
||||
{% set allowed_tags = '<b><strong><sup><sub><s><em><i><u><a><del><span><br>' %}
|
||||
<label
|
||||
{{ id_attribute }}
|
||||
class="{{ classes }}"
|
||||
{{ for_attribute }}
|
||||
data-interaction-id="{{ id }}"
|
||||
{{ settings.attributes | raw }}
|
||||
{{ interactions_attribute }}
|
||||
>{{ settings.text | striptags(allowed_tags) | raw }}</label>
|
||||
27
modules/atomic-form/templates/textarea.html.twig
Normal file
27
modules/atomic-form/templates/textarea.html.twig
Normal file
@@ -0,0 +1,27 @@
|
||||
{% set classes = settings.classes | merge( [ base_styles.base ] ) | join(' ') | trim %}
|
||||
{% set id_attribute = settings._cssid is not empty ? 'id=' ~ settings._cssid | e('html_attr') : '' %}
|
||||
{% set interactions_attribute = interactions is not empty ? 'data-interactions=' ~ interactions | json_encode | e('html_attr') : '' %}
|
||||
{% set placeholder_attribute = settings.placeholder is not empty ? 'placeholder=' ~ settings.placeholder | e('html_attr') : '' %}
|
||||
{% set required_attribute = settings.required ? 'required' : '' %}
|
||||
{% set readonly_attribute = settings.readonly ? 'readonly' : '' %}
|
||||
{% set rows_attribute = settings.rows is not empty ? 'rows=' ~ settings.rows | e('html_attr') : '' %}
|
||||
{% set minlength_attribute = settings.minlength is not empty ? 'minlength=' ~ settings.minlength | e('html_attr') : '' %}
|
||||
{% set maxlength_attribute = settings.maxlength is not empty ? 'maxlength=' ~ settings.maxlength | e('html_attr') : '' %}
|
||||
{% set resizable_attribute = settings.resizable ? 'data-resizable' : '' %}
|
||||
{% set name = settings.name is not empty ? settings.name : settings._cssid is not empty ? settings._cssid : id %}
|
||||
{% set name_attribute = 'name=' ~ name | e('html_attr') %}
|
||||
<textarea
|
||||
{{ id_attribute }}
|
||||
{{ name_attribute }}
|
||||
class="{{ classes }}"
|
||||
data-interaction-id="{{ id }}"
|
||||
{{ settings.attributes | raw }}
|
||||
{{ interactions_attribute }}
|
||||
{{ placeholder_attribute }}
|
||||
{{ required_attribute }}
|
||||
{{ readonly_attribute }}
|
||||
{{ rows_attribute }}
|
||||
{{ minlength_attribute }}
|
||||
{{ maxlength_attribute }}
|
||||
{{ resizable_attribute }}
|
||||
></textarea>
|
||||
121
modules/atomic-form/widgets/input.php
Normal file
121
modules/atomic-form/widgets/input.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\AtomicForm\Widgets;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Section;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Select_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Switch_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base;
|
||||
use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Template;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Input extends Atomic_Widget_Base {
|
||||
use Has_Template;
|
||||
|
||||
public static $widget_description = 'Display a text input with customizable type, placeholder, default value, required, readonly, and attributes.';
|
||||
|
||||
public static function get_element_type(): string {
|
||||
return 'e-form-input';
|
||||
}
|
||||
|
||||
public function get_title(): string {
|
||||
return esc_html__( 'Input', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_icon(): string {
|
||||
return 'eicon-atomic-input';
|
||||
}
|
||||
|
||||
public function get_categories(): array {
|
||||
return [ 'atomic-form' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [ 'atomic', 'form', 'input', 'text', 'email' ];
|
||||
}
|
||||
|
||||
protected static function define_props_schema(): array {
|
||||
return [
|
||||
'classes' => Classes_Prop_Type::make()
|
||||
->default( [] ),
|
||||
'placeholder' => String_Prop_Type::make()
|
||||
->default( '' ),
|
||||
'type' => String_Prop_Type::make()
|
||||
->default( 'text' )
|
||||
->enum( [ 'text', 'email' ] ),
|
||||
'required' => Boolean_Prop_Type::make()
|
||||
->default( false ),
|
||||
'readonly' => Boolean_Prop_Type::make()
|
||||
->default( false ),
|
||||
'attributes' => Attributes_Prop_Type::make(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function define_atomic_controls(): array {
|
||||
return [
|
||||
Section::make()
|
||||
->set_label( __( 'Content', 'elementor-pro' ) )
|
||||
->set_items( [
|
||||
Text_Control::bind_to( 'placeholder' )
|
||||
->set_placeholder( 'Enter placeholder text' )
|
||||
->set_label( __( 'Input placeholder', 'elementor-pro' ) ),
|
||||
Select_Control::bind_to( 'type' )
|
||||
->set_label( __( 'Type', 'elementor-pro' ) )
|
||||
->set_options( [
|
||||
[
|
||||
'label' => __( 'Text', 'elementor-pro' ),
|
||||
'value' => 'text',
|
||||
],
|
||||
[
|
||||
'label' => __( 'Email', 'elementor-pro' ),
|
||||
'value' => 'email',
|
||||
],
|
||||
] ),
|
||||
Switch_Control::bind_to( 'required' )
|
||||
->set_label( __( 'Required', 'elementor-pro' ) ),
|
||||
Switch_Control::bind_to( 'readonly' )
|
||||
->set_label( __( 'Read only', 'elementor-pro' ) ),
|
||||
] ),
|
||||
Section::make()
|
||||
->set_label( __( 'Settings', 'elementor-pro' ) )
|
||||
->set_id( 'settings' )
|
||||
->set_items( $this->get_settings_controls() ),
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_settings_controls(): array {
|
||||
return [
|
||||
Text_Control::bind_to( '_cssid' )
|
||||
->set_label( __( 'ID', 'elementor-pro' ) )
|
||||
->set_meta( $this->get_css_id_control_meta() ),
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_templates(): array {
|
||||
return [
|
||||
'input' => __DIR__ . '/../templates/input.html.twig',
|
||||
];
|
||||
}
|
||||
|
||||
protected function define_base_styles(): array {
|
||||
return [
|
||||
'base' => Style_Definition::make(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_css_id_control_meta(): array {
|
||||
return [
|
||||
'layout' => 'two-columns',
|
||||
'topDivider' => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
97
modules/atomic-form/widgets/label.php
Normal file
97
modules/atomic-form/widgets/label.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\AtomicForm\Widgets;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Section;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Inline_Editing_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base;
|
||||
use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Template;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Html_Prop_Type;
|
||||
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Label extends Atomic_Widget_Base {
|
||||
use Has_Template;
|
||||
|
||||
public static $widget_description = 'Display a label with customizable text and for attribute.';
|
||||
|
||||
public static function get_element_type(): string {
|
||||
return 'e-form-label';
|
||||
}
|
||||
|
||||
public function get_title(): string {
|
||||
return esc_html__( 'Label', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_icon(): string {
|
||||
return 'eicon-atomic-label';
|
||||
}
|
||||
|
||||
public function get_categories(): array {
|
||||
return [ 'atomic-form' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [ 'atomic', 'form', 'label', 'text' ];
|
||||
}
|
||||
|
||||
protected static function define_props_schema(): array {
|
||||
return [
|
||||
'classes' => Classes_Prop_Type::make()
|
||||
->default( [] ),
|
||||
'text' => Html_Prop_Type::make()
|
||||
->default( 'Form label' ),
|
||||
'input-id' => String_Prop_Type::make()
|
||||
->default( '' ),
|
||||
'attributes' => Attributes_Prop_Type::make(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function define_atomic_controls(): array {
|
||||
return [
|
||||
Section::make()
|
||||
->set_label( __( 'Content', 'elementor-pro' ) )
|
||||
->set_items( [
|
||||
Inline_Editing_Control::bind_to( 'text' )
|
||||
->set_label( __( 'Label text', 'elementor-pro' ) ),
|
||||
Text_Control::bind_to( 'input-id' )
|
||||
->set_label( __( 'Connected to input ID', 'elementor-pro' ) )
|
||||
->set_meta( [
|
||||
'layout' => 'two-columns',
|
||||
] ),
|
||||
] ),
|
||||
Section::make()
|
||||
->set_label( __( 'Settings', 'elementor-pro' ) )
|
||||
->set_id( 'settings' )
|
||||
->set_items( $this->get_settings_controls() ),
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_settings_controls(): array {
|
||||
return [
|
||||
Text_Control::bind_to( '_cssid' )
|
||||
->set_label( __( 'ID', 'elementor-pro' ) )
|
||||
->set_meta( $this->get_css_id_control_meta() ),
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_templates(): array {
|
||||
return [
|
||||
'label' => __DIR__ . '/../templates/label.html.twig',
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_css_id_control_meta(): array {
|
||||
return [
|
||||
'layout' => 'two-columns',
|
||||
'topDivider' => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
126
modules/atomic-form/widgets/textarea.php
Normal file
126
modules/atomic-form/widgets/textarea.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\AtomicForm\Widgets;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Section;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Number_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Switch_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base;
|
||||
use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Template;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Number_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Textarea extends Atomic_Widget_Base {
|
||||
use Has_Template;
|
||||
|
||||
public static $widget_description = 'Display a text area with customizable type, placeholder, default value, required, readonly, and attributes.';
|
||||
|
||||
public static function get_element_type(): string {
|
||||
return 'e-form-textarea';
|
||||
}
|
||||
|
||||
public function get_title(): string {
|
||||
return esc_html__( 'Text area', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_icon(): string {
|
||||
return 'eicon-atomic-text-area';
|
||||
}
|
||||
|
||||
public function get_categories(): array {
|
||||
return [ 'atomic-form' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [ 'atomic', 'form', 'textarea', 'text', 'email' ];
|
||||
}
|
||||
|
||||
protected static function define_props_schema(): array {
|
||||
return [
|
||||
'classes' => Classes_Prop_Type::make()
|
||||
->default( [] ),
|
||||
'placeholder' => String_Prop_Type::make()
|
||||
->default( '' ),
|
||||
'rows' => Number_Prop_Type::make()
|
||||
->default( 4 ),
|
||||
'required' => Boolean_Prop_Type::make()
|
||||
->default( false ),
|
||||
'readonly' => Boolean_Prop_Type::make()
|
||||
->default( false ),
|
||||
'resizable' => Boolean_Prop_Type::make()
|
||||
->default( true ),
|
||||
'minlength' => Number_Prop_Type::make(),
|
||||
'maxlength' => Number_Prop_Type::make(),
|
||||
'attributes' => Attributes_Prop_Type::make(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function define_atomic_controls(): array {
|
||||
return [
|
||||
Section::make()
|
||||
->set_label( __( 'Content', 'elementor-pro' ) )
|
||||
->set_items( [
|
||||
Text_Control::bind_to( 'placeholder' )
|
||||
->set_placeholder( 'Enter placeholder text' )
|
||||
->set_label( __( 'Text area placeholder', 'elementor-pro' ) ),
|
||||
Number_Control::bind_to( 'rows' )
|
||||
->set_label( __( 'Rows', 'elementor-pro' ) )
|
||||
->set_min( 1 )
|
||||
->set_step( 1 ),
|
||||
Switch_Control::bind_to( 'required' )
|
||||
->set_label( __( 'Required', 'elementor-pro' ) ),
|
||||
Switch_Control::bind_to( 'readonly' )
|
||||
->set_label( __( 'Read only', 'elementor-pro' ) ),
|
||||
Switch_Control::bind_to( 'resizable' )
|
||||
->set_label( __( 'Resizable', 'elementor-pro' ) ),
|
||||
Number_Control::bind_to( 'minlength' )
|
||||
->set_label( __( 'Min length', 'elementor-pro' ) )
|
||||
->set_min( 0 )
|
||||
->set_step( 1 ),
|
||||
Number_Control::bind_to( 'maxlength' )
|
||||
->set_label( __( 'Max length', 'elementor-pro' ) )
|
||||
->set_min( 0 )
|
||||
->set_step( 1 ),
|
||||
] ),
|
||||
Section::make()
|
||||
->set_label( __( 'Settings', 'elementor-pro' ) )
|
||||
->set_id( 'settings' )
|
||||
->set_items( $this->get_settings_controls() ),
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_settings_controls(): array {
|
||||
return [
|
||||
Text_Control::bind_to( '_cssid' )
|
||||
->set_label( __( 'ID', 'elementor-pro' ) )
|
||||
->set_meta( $this->get_css_id_control_meta() ),
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_templates(): array {
|
||||
return [
|
||||
'textarea' => __DIR__ . '/../templates/textarea.html.twig',
|
||||
];
|
||||
}
|
||||
|
||||
protected function define_base_styles(): array {
|
||||
return [
|
||||
'base' => Style_Definition::make(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function get_css_id_control_meta(): array {
|
||||
return [
|
||||
'layout' => 'two-columns',
|
||||
'topDivider' => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -41,8 +41,24 @@ class Module extends Module_Base {
|
||||
}
|
||||
|
||||
private function inject_props_schema( $schema ) {
|
||||
$schema[ Display_Conditions_Prop_Type::get_key() ] = Display_Conditions_Prop_Type::make();
|
||||
$display_conditions_prop_type = Display_Conditions_Prop_Type::make();
|
||||
|
||||
$components_module = 'Elementor\\Modules\\Components\\Module';
|
||||
$overridable_prop_type = 'Elementor\\Modules\\Components\\PropTypes\\Overridable_Prop_Type';
|
||||
|
||||
$is_components_experiment_active = false;
|
||||
if ( class_exists( $components_module ) ) {
|
||||
$is_components_experiment_active = Plugin::elementor()->experiments->is_feature_active( $components_module::EXPERIMENT_NAME );
|
||||
}
|
||||
|
||||
if (
|
||||
$is_components_experiment_active &&
|
||||
class_exists( $overridable_prop_type )
|
||||
) {
|
||||
$display_conditions_prop_type->meta( $overridable_prop_type::ignore() );
|
||||
}
|
||||
|
||||
$schema[ Display_Conditions_Prop_Type::get_key() ] = $display_conditions_prop_type;
|
||||
return $schema;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,23 +14,23 @@ class Custom_Code_Menu_Item implements Admin_Menu_Item {
|
||||
|
||||
const LICENSE_FEATURE_NAME = 'custom_code';
|
||||
|
||||
public function get_capability() {
|
||||
public function get_capability(): string {
|
||||
return CustomCodeModule::CAPABILITY;
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Custom Code', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Settings::PAGE_ID;
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
public function get_position(): ?int {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function is_visible() {
|
||||
public function is_visible(): bool {
|
||||
return API::is_licence_has_feature( static::LICENSE_FEATURE_NAME, API::BC_VALIDATION_CALLBACK );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\CustomCode\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\CustomCode\AdminMenuItems\Custom_Code_Menu_Item;
|
||||
use ElementorPro\Modules\CustomCode\Module;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Custom_Code_Menu_Item extends Custom_Code_Menu_Item implements Menu_Item_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 30;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Module::MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Code', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::CUSTOM_ELEMENTS_GROUP_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\CustomCode\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\CustomCode\AdminMenuItems\Custom_Code_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\CustomCode\Module;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Custom_Code_Promotion extends Custom_Code_Promotion_Menu_Item implements Menu_Item_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 30;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Module::PROMOTION_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Code', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::CUSTOM_ELEMENTS_GROUP_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,17 @@ namespace ElementorPro\Modules\CustomCode;
|
||||
use Elementor\Core\Admin\Menu\Admin_Menu_Manager;
|
||||
use Elementor\Core\Documents_Manager;
|
||||
use Elementor\Icons_Manager;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
|
||||
use Elementor\Settings;
|
||||
use Elementor\TemplateLibrary\Source_Local;
|
||||
use Elementor\Utils;
|
||||
use ElementorPro\Base\Editor_One_Trait;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\Modules\CustomCode\AdminMenuItems\Custom_Code_Menu_Item;
|
||||
use ElementorPro\Modules\CustomCode\AdminMenuItems\Custom_Code_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\CustomCode\EditorOneMenuItems\Editor_One_Custom_Code_Menu_Item;
|
||||
use ElementorPro\Modules\CustomCode\EditorOneMenuItems\Editor_One_Custom_Code_Promotion;
|
||||
use ElementorPro\Modules\CustomCode\ImportExport\Import_Export as Custom_Code_Import_Export;
|
||||
use ElementorPro\Modules\CustomCode\ImportExportCustomization\Import_Export_Customization as Custom_Code_Import_Export_Customization;
|
||||
use ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager;
|
||||
@@ -22,6 +26,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
use Editor_One_Trait;
|
||||
|
||||
const CAPABILITY = 'manage_options';
|
||||
const CPT = 'elementor_snippet';
|
||||
const MODULE_NAME = 'custom_code';
|
||||
@@ -72,6 +78,10 @@ class Module extends Module_Base {
|
||||
}
|
||||
|
||||
add_action( 'elementor/admin/menu/register', function ( Admin_Menu_Manager $admin_menu_manager ) {
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->add_admin_menu( $admin_menu_manager );
|
||||
} );
|
||||
|
||||
@@ -91,6 +101,14 @@ class Module extends Module_Base {
|
||||
);
|
||||
}, /* After custom icons */ 51 );
|
||||
|
||||
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
|
||||
if ( $this->can_use_custom_code() ) {
|
||||
$menu_data_provider->register_menu( new Editor_One_Custom_Code_Menu_Item() );
|
||||
} else {
|
||||
$menu_data_provider->register_menu( new Editor_One_Custom_Code_Promotion() );
|
||||
}
|
||||
} );
|
||||
|
||||
add_action( 'current_screen', function () {
|
||||
if ( ! is_admin() ) {
|
||||
return;
|
||||
@@ -108,6 +126,12 @@ class Module extends Module_Base {
|
||||
}
|
||||
} );
|
||||
|
||||
add_filter( 'elementor/editor-one/admin-edit-post-types', function ( array $post_types ) {
|
||||
$post_types[] = self::CPT;
|
||||
|
||||
return $post_types;
|
||||
} );
|
||||
|
||||
$this->frontend_actions();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace ElementorPro\Modules\DynamicTags\ACF\Tags;
|
||||
|
||||
use ElementorPro\Modules\DynamicTags\Tags\Base\Data_Tag;
|
||||
use ElementorPro\Modules\DynamicTags\ACF\Module;
|
||||
use ElementorPro\Modules\DynamicTags\Module as DynamicTagsModule;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
@@ -23,7 +24,14 @@ class ACF_URL extends Data_Tag {
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ Module::URL_CATEGORY ];
|
||||
$categories = [
|
||||
Module::URL_CATEGORY,
|
||||
];
|
||||
|
||||
// TODO: Remove this in 3.37.0
|
||||
$categories = DynamicTagsModule::add_v4_svg_category( $categories );
|
||||
|
||||
return $categories;
|
||||
}
|
||||
|
||||
public function get_panel_template_setting_key() {
|
||||
|
||||
@@ -91,7 +91,7 @@ class Module extends TagsModule {
|
||||
}
|
||||
|
||||
public function get_tag_classes_names() {
|
||||
return [
|
||||
$tags = [
|
||||
'Archive_Description',
|
||||
'Archive_Meta',
|
||||
'Archive_Title',
|
||||
@@ -104,7 +104,6 @@ class Module extends TagsModule {
|
||||
'Comments_Number',
|
||||
'Comments_URL',
|
||||
'Page_Title',
|
||||
'Post_Custom_Field',
|
||||
'Post_Date',
|
||||
'Post_Excerpt',
|
||||
'Post_Featured_Image',
|
||||
@@ -129,6 +128,13 @@ class Module extends TagsModule {
|
||||
'User_Info',
|
||||
'User_Profile_Picture',
|
||||
];
|
||||
$tier = API::get_access_tier();
|
||||
|
||||
if ( 'essential' !== $tier ) {
|
||||
$tags[] = 'Post_Custom_Field';
|
||||
}
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
public function get_groups() {
|
||||
@@ -159,4 +165,11 @@ class Module extends TagsModule {
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
// TODO: Remove this in 3.37.0
|
||||
public static function add_v4_svg_category( $categories ) {
|
||||
return defined( 'Elementor\Modules\DynamicTags\Module::SVG_CATEGORY' )
|
||||
? array_merge( $categories, [ \Elementor\Modules\DynamicTags\Module::SVG_CATEGORY ] )
|
||||
: $categories;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,10 @@ class Contact_URL extends Tag {
|
||||
return Module::ACTION_GROUP;
|
||||
}
|
||||
|
||||
public function get_atomic_group() {
|
||||
return Module::SITE_GROUP;
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ Module::URL_CATEGORY ];
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class Post_Custom_Field extends Tag {
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [
|
||||
$categories = [
|
||||
Module::TEXT_CATEGORY,
|
||||
Module::URL_CATEGORY,
|
||||
Module::POST_META_CATEGORY,
|
||||
@@ -32,6 +32,11 @@ class Post_Custom_Field extends Tag {
|
||||
Module::DATETIME_CATEGORY,
|
||||
Module::MEDIA_CATEGORY,
|
||||
];
|
||||
|
||||
// TODO: Remove this in 3.37.0
|
||||
$categories = Module::add_v4_svg_category( $categories );
|
||||
|
||||
return $categories;
|
||||
}
|
||||
|
||||
public function get_panel_template_setting_key() {
|
||||
|
||||
55
modules/editor-one/module.php
Normal file
55
modules/editor-one/module.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\EditorOne;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Menu\Editor_One_Custom_Elements_Menu;
|
||||
use Elementor\Core\Base\Module as BaseModule;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
|
||||
use Elementor\Plugin;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorOne\Admin\Components\Page;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Module extends BaseModule {
|
||||
const UPGRADE_URL = 'https://go.elementor.com/go-pro-upgrade-one-wp-menu-pro/';
|
||||
|
||||
public function get_name(): string {
|
||||
return 'editor-one';
|
||||
}
|
||||
|
||||
public static function is_active(): bool {
|
||||
return (bool) Plugin::instance()->modules_manager->get_modules( 'editor-one' );
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
add_filter( 'elementor/modules/editor-one/is_pro_module_enabled', '__return_true' );
|
||||
add_filter( 'elementor/editor-one/menu/legacy_pro_mapping', [ $this, 'add_legacy_pro_mapping' ] );
|
||||
|
||||
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
|
||||
$menu_data_provider->register_menu( new Editor_One_Custom_Elements_Menu() );
|
||||
} );
|
||||
|
||||
add_filter( 'elementor_one/upgrade_url', function() : string {
|
||||
return self::UPGRADE_URL;
|
||||
}, PHP_INT_MAX );
|
||||
|
||||
if ( API::is_license_active() && class_exists( '\ElementorOne\Admin\Components\Page' ) ) {
|
||||
$instance = Page::instance();
|
||||
if ( $instance && method_exists( $instance, 'upgrade_menu_item' ) ) {
|
||||
remove_action( 'admin_menu', [ $instance, 'upgrade_menu_item' ], PHP_INT_MAX );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function add_legacy_pro_mapping( array $mapping ): array {
|
||||
$mapping[ Menu_Config::ELEMENTOR_MENU_SLUG ] = [ 'group' => Menu_Config::EDITOR_GROUP_ID ];
|
||||
|
||||
return $mapping;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
namespace ElementorPro\Modules\Forms\Actions;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Core\Admin\Admin_Notices;
|
||||
use ElementorPro\Core\Utils\Hints;
|
||||
use ElementorPro\Core\Utils;
|
||||
use ElementorPro\Core\Utils\Collection;
|
||||
@@ -227,13 +228,69 @@ class Email extends Action_Base {
|
||||
|
||||
public function maybe_add_site_mailer_notice( $widget ) {
|
||||
$notice_id = 'site_mailer_forms_email_notice';
|
||||
|
||||
if ( ! Hints::should_show_hint( $notice_id ) ) {
|
||||
return;
|
||||
}
|
||||
$notice_content = esc_html__( 'Experiencing email deliverability issues? Get your emails delivered with Site Mailer.', 'elementor-pro' );
|
||||
|
||||
if ( 2 === Utils\Abtest::get_variation( 'plg_site_mailer_submission' ) ) {
|
||||
$notice_content = esc_html__( 'Make sure your emails reach the inbox every time with Site Mailer', 'elementor-pro' );
|
||||
$plugin_slug = 'site-mailer';
|
||||
|
||||
$one_subscription = method_exists( Hints::class, 'is_plugin_connected_to_one_subscription' ) && Hints::is_plugin_connected_to_one_subscription();
|
||||
$is_installed = Hints::is_plugin_installed( $plugin_slug );
|
||||
$is_active = Hints::is_plugin_active( $plugin_slug );
|
||||
|
||||
if ( $is_active ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $one_subscription ) {
|
||||
if ( ! $is_installed ) {
|
||||
$notice_content = esc_html__( 'Make sure your site’s emails reach the inbox every time. Site Mailer is included in your ONE subscription.', 'elementor-pro' );
|
||||
$button_text = esc_html__( 'Install now', 'elementor-pro' );
|
||||
$button_url = Hints::get_plugin_install_url( $plugin_slug );
|
||||
$campaign_data = [
|
||||
'name' => 'site_mailer_forms_email_notice',
|
||||
'campaign' => 'sm-plg-form-v1-one-install',
|
||||
'source' => 'sm-editor-form-one-install',
|
||||
'medium' => 'wp-dash-one',
|
||||
];
|
||||
} elseif ( ! $is_active ) {
|
||||
$notice_content = esc_html__( 'Ensure your site’s emails reach the inbox every time. Site Mailer is included in your ONE subscription. Activate it to continue.', 'elementor-pro' );
|
||||
$button_text = esc_html__( 'Activate now', 'elementor-pro' );
|
||||
$button_url = Hints::get_plugin_activate_url( $plugin_slug );
|
||||
$campaign_data = [
|
||||
'name' => 'site_mailer_forms_email_notice',
|
||||
'campaign' => 'sm-plg-form-v1-one-activate',
|
||||
'source' => 'sm-editor-form-one-activate',
|
||||
'medium' => 'wp-dash-one',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$notice_content = esc_html__( 'Experiencing email deliverability issues? Get your emails delivered with Site Mailer.', 'elementor-pro' );
|
||||
|
||||
if ( 2 === Utils\Abtest::get_variation( 'plg_site_mailer_submission' ) ) {
|
||||
$notice_content = esc_html__( 'Make sure your emails reach the inbox every time with Site Mailer.', 'elementor-pro' );
|
||||
}
|
||||
|
||||
if ( ! $is_installed ) {
|
||||
$button_text = esc_html__( 'Install now', 'elementor-pro' );
|
||||
$button_url = Hints::get_plugin_install_url( $plugin_slug );
|
||||
$campaign_data = [
|
||||
'name' => 'site_mailer_forms_email_notice',
|
||||
'campaign' => 'sm-form-install',
|
||||
'source' => 'sm-plg-form-v1-install',
|
||||
'medium' => 'wp-dash',
|
||||
];
|
||||
} elseif ( ! $is_active ) {
|
||||
$button_text = esc_html__( 'Activate now', 'elementor-pro' );
|
||||
$button_url = Hints::get_plugin_activate_url( $plugin_slug );
|
||||
$campaign_data = [
|
||||
'name' => 'site_mailer_forms_email_notice',
|
||||
'campaign' => 'sm-form-activate',
|
||||
'source' => 'sm-plg-form-v1-activate',
|
||||
'medium' => 'wp-dash',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$widget->add_control(
|
||||
@@ -246,10 +303,11 @@ class Email extends Action_Base {
|
||||
'content' => $notice_content,
|
||||
'icon' => true,
|
||||
'dismissible' => $notice_id,
|
||||
'button_text' => Hints::is_plugin_installed( 'site-mailer' ) ? __( 'Activate Plugin', 'elementor-pro' ) : __( 'Install Plugin', 'elementor-pro' ),
|
||||
'button_text' => $button_text,
|
||||
'button_event' => $notice_id,
|
||||
'button_data' => [
|
||||
'action_url' => Hints::get_plugin_action_url( 'site-mailer' ),
|
||||
'action_url' => $button_url,
|
||||
'source' => $campaign_data['source'],
|
||||
],
|
||||
], true ),
|
||||
]
|
||||
|
||||
@@ -2,29 +2,34 @@
|
||||
namespace ElementorPro\Modules\Forms;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Settings;
|
||||
use Elementor\Core\Admin\Admin_Notices;
|
||||
use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
|
||||
use ElementorPro\Core\Upgrade\Manager as Upgrade_Manager;
|
||||
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
|
||||
use Elementor\Settings;
|
||||
use Elementor\User;
|
||||
use ElementorPro\Core\Utils;
|
||||
use ElementorPro\Modules\Forms\Data\Controller;
|
||||
use ElementorPro\Base\Editor_One_Trait;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\Core\Upgrade\Manager as Upgrade_Manager;
|
||||
use ElementorPro\Core\Utils;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\Modules\Forms\Controls\Fields_Map;
|
||||
use ElementorPro\Modules\Forms\Controls\Fields_Repeater;
|
||||
use ElementorPro\Modules\Forms\Data\Controller;
|
||||
use ElementorPro\Modules\Forms\Registrars\Form_Actions_Registrar;
|
||||
use ElementorPro\Modules\Forms\Registrars\Form_Fields_Registrar;
|
||||
use ElementorPro\Modules\Forms\Submissions\Component as Form_Submissions_Component;
|
||||
use ElementorPro\Modules\Forms\Controls\Fields_Repeater;
|
||||
use ElementorPro\Plugin;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\Modules\Forms\Submissions\AdminMenuItems\Submissions_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\Forms\Submissions\Component as Form_Submissions_Component;
|
||||
use ElementorPro\Modules\Forms\Submissions\EditorOneMenuItems\Editor_One_Submissions_Menu_Item;
|
||||
use ElementorPro\Modules\Forms\Submissions\EditorOneMenuItems\Editor_One_Submissions_Promotion;
|
||||
use ElementorPro\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
use Editor_One_Trait;
|
||||
|
||||
/**
|
||||
* @var Form_Actions_Registrar
|
||||
*/
|
||||
@@ -195,6 +200,10 @@ class Module extends Module_Base {
|
||||
$this->add_component( $name, new Form_Submissions_Component() );
|
||||
}
|
||||
|
||||
private function are_submissions_disabled(): bool {
|
||||
return '1' === get_option( 'elementor_' . Form_Submissions_Component::NAME );
|
||||
}
|
||||
|
||||
public function register_submissions_admin_fields( Settings $settings ) {
|
||||
$settings->add_field(
|
||||
Settings::TAB_ADVANCED,
|
||||
@@ -209,15 +218,12 @@ class Module extends Module_Base {
|
||||
'' => esc_html__( 'Enable', 'elementor-pro' ),
|
||||
'1' => esc_html__( 'Disable', 'elementor-pro' ),
|
||||
],
|
||||
'desc' => esc_html__( 'Never lose another submission! Using “Actions After Submit” you can now choose to save all submissions to an internal database.', 'elementor-pro' ),
|
||||
'desc' => esc_html__( 'Never lose another submission! Using "Actions After Submit" you can now choose to save all submissions to an internal database.', 'elementor-pro' ),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Module constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
@@ -238,10 +244,30 @@ class Module extends Module_Base {
|
||||
$this->register_submissions_component();
|
||||
} else {
|
||||
add_action( 'elementor/admin/menu/register', function( $admin_menu ) {
|
||||
if ( $this->are_submissions_disabled() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$admin_menu->register( Form_Submissions_Component::PAGE_ID, new Submissions_Promotion_Menu_Item() );
|
||||
}, 9 /* After "Settings" */ );
|
||||
}
|
||||
|
||||
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
|
||||
if ( $this->are_submissions_disabled() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( API::is_licence_has_feature( Form_Submissions_Component::NAME ) ) {
|
||||
$menu_data_provider->register_menu( new Editor_One_Submissions_Menu_Item() );
|
||||
} else {
|
||||
$menu_data_provider->register_menu( new Editor_One_Submissions_Promotion() );
|
||||
}
|
||||
} );
|
||||
|
||||
// Initialize registrars.
|
||||
$this->actions_registrar = new Form_Actions_Registrar();
|
||||
$this->fields_registrar = new Form_Fields_Registrar();
|
||||
|
||||
@@ -15,31 +15,31 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Submissions_Menu_Item implements Admin_Menu_Item_With_Page {
|
||||
public function get_capability() {
|
||||
public function get_capability(): string {
|
||||
return 'manage_options';
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Submissions', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_page_title() {
|
||||
public function get_page_title(): string {
|
||||
return esc_html__( 'Submissions', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Settings::PAGE_ID;
|
||||
}
|
||||
|
||||
public function is_visible() {
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
return null;
|
||||
public function get_position(): ?int {
|
||||
return 50;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
public function render(): void {
|
||||
$this->maybe_render_hints();
|
||||
?>
|
||||
<div class="wrap">
|
||||
@@ -55,61 +55,98 @@ class Submissions_Menu_Item implements Admin_Menu_Item_With_Page {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->should_show_send_app_hint() ) {
|
||||
$this->render_send_app_notice();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->should_show_site_mailer_hint() ) {
|
||||
$this->render_site_mailer_notice();
|
||||
}
|
||||
}
|
||||
|
||||
private function render_site_mailer_notice() {
|
||||
/**
|
||||
* @var Admin_Notices $admin_notices
|
||||
*/
|
||||
$admin_notices = Plugin::elementor()->admin->get_component( 'admin-notices' );
|
||||
$notice_id = 'site_mailer_forms_submissions_notice';
|
||||
|
||||
$notice_options = [
|
||||
'description' => esc_html__( 'Experiencing email deliverability issues? Get your emails delivered with Site Mailer.', 'elementor-pro' ),
|
||||
'id' => 'site_mailer_forms_submissions_notice',
|
||||
'type' => 'cta',
|
||||
'button_secondary' => [
|
||||
'text' => Hints::is_plugin_installed( 'site-mailer' ) ? esc_html__( 'Activate Plugin', 'elementor-pro' ) : esc_html__( 'Install Plugin', 'elementor-pro' ),
|
||||
'url' => Hints::get_plugin_action_url( 'site-mailer' ),
|
||||
'type' => 'cta',
|
||||
],
|
||||
];
|
||||
|
||||
if ( 2 === Abtest::get_variation( 'plg_site_mailer_submission' ) ) {
|
||||
$notice_options['title'] = esc_html__( 'Get Your Emails Delivered With Site Mailer', 'elementor-pro' );
|
||||
$notice_options['description'] = esc_html__( 'Make sure emails reach the inbox every time with improved deliverability, detailed email logs, and an easy setup with no need for an SMTP plugin.', 'elementor-pro' );
|
||||
if ( ! current_user_can( 'install_plugins' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$admin_notices->print_admin_notice( $notice_options );
|
||||
}
|
||||
$plugin_slug = 'site-mailer';
|
||||
|
||||
$one_subscription = method_exists( Hints::class, 'is_plugin_connected_to_one_subscription' ) && Hints::is_plugin_connected_to_one_subscription();
|
||||
$is_installed = Hints::is_plugin_installed( $plugin_slug );
|
||||
$is_active = Hints::is_plugin_active( $plugin_slug );
|
||||
|
||||
if ( $is_active ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $one_subscription ) {
|
||||
$title = esc_html__( 'Get your emails delivered with Site Mailer', 'elementor-pro' );
|
||||
|
||||
if ( ! $is_installed ) {
|
||||
$description = esc_html__( 'Ensure form submission emails reach the inbox and track delivery with built-in logs. Site Mailer is included in your ONE subscription.', 'elementor-pro' );
|
||||
$button_text = esc_html__( 'Install now', 'elementor-pro' );
|
||||
$button_url = Hints::get_plugin_install_url( $plugin_slug );
|
||||
$campaign_data = [
|
||||
'name' => 'site_mailer_forms_submissions_notice',
|
||||
'campaign' => 'sm-plg-submission-v1',
|
||||
'source' => 'sm-submission-one-install',
|
||||
'medium' => 'wp-dash-one',
|
||||
];
|
||||
} elseif ( ! $is_active ) {
|
||||
$description = esc_html__( 'Ensure form submission emails reach the inbox and track delivery with built-in logs. Site Mailer is included in your ONE subscription. Activate it to continue.', 'elementor-pro' );
|
||||
$button_text = esc_html__( 'Activate now', 'elementor-pro' );
|
||||
$button_url = Hints::get_plugin_action_url( $plugin_slug );
|
||||
$campaign_data = [
|
||||
'name' => 'site_mailer_forms_submissions_notice',
|
||||
'campaign' => 'sm-plg-submission-v1',
|
||||
'source' => 'sm-submission-one-activate',
|
||||
'medium' => 'wp-dash-one',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$title = esc_html__( 'Get Your Emails Delivered With Site Mailer', 'elementor-pro' );
|
||||
$description = esc_html__( 'Make sure emails reach the inbox every time with improved deliverability, detailed email logs, and an easy setup with no need for an SMTP plugin.', 'elementor-pro' );
|
||||
|
||||
if ( ! $is_installed ) {
|
||||
$button_text = esc_html__( 'Install now', 'elementor-pro' );
|
||||
$button_url = Hints::get_plugin_install_url( $plugin_slug );
|
||||
$campaign_data = [
|
||||
'name' => 'site_mailer_forms_submissions_notice',
|
||||
'campaign' => 'sm-plg-submission-v1',
|
||||
'source' => 'sm-submission-install',
|
||||
'medium' => 'wp-dash',
|
||||
];
|
||||
} elseif ( ! $is_active ) {
|
||||
$button_text = esc_html__( 'Activate now', 'elementor-pro' );
|
||||
$button_url = Hints::get_plugin_action_url( $plugin_slug );
|
||||
$campaign_data = [
|
||||
'name' => 'site_mailer_forms_submissions_notice',
|
||||
'campaign' => 'sm-plg-submission-v1',
|
||||
'source' => 'sm-submission-activate',
|
||||
'medium' => 'wp-dash',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$notice_options = [
|
||||
'id' => $notice_id,
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'type' => 'cta',
|
||||
'button_secondary' => [
|
||||
'text' => $button_text,
|
||||
'url' => $button_url,
|
||||
'type' => 'cta',
|
||||
'data' => [
|
||||
'source' => $campaign_data['source'],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
private function render_send_app_notice() {
|
||||
/**
|
||||
* @var Admin_Notices $admin_notices
|
||||
*/
|
||||
$admin_notices = Plugin::elementor()->admin->get_component( 'admin-notices' );
|
||||
|
||||
$send_app_notice_options = [
|
||||
'title' => esc_html__( 'Forms are just the beginning', 'elementor-pro' ),
|
||||
'description' => esc_html__( 'Turn submissions into leads with automated replies, welcome series, and smart tagging — all inside WordPress.
|
||||
With Send, you build relationships from the first interaction.', 'elementor-pro' ),
|
||||
'id' => 'send_app_forms_submissions_notice',
|
||||
'type' => 'cta',
|
||||
'button_secondary' => [
|
||||
'text' => Hints::is_plugin_installed( 'send-app' ) ? esc_html__( 'Activate Send Now', 'elementor-pro' ) : esc_html__( 'Install Send Now', 'elementor-pro' ),
|
||||
'url' => Hints::get_plugin_action_url( 'send-app' ),
|
||||
'type' => 'cta',
|
||||
],
|
||||
];
|
||||
|
||||
$admin_notices->print_admin_notice( $send_app_notice_options );
|
||||
$admin_notices->print_admin_notice( $notice_options );
|
||||
}
|
||||
|
||||
public function has_submissions( $min_count = 1 ): bool {
|
||||
@@ -127,14 +164,4 @@ With Send, you build relationships from the first interaction.', 'elementor-pro'
|
||||
&& ! User::is_user_notice_viewed( 'site_mailer_forms_submissions_notice' )
|
||||
);
|
||||
}
|
||||
|
||||
public function should_show_send_app_hint(): bool {
|
||||
if ( Hints::is_plugin_active( 'woocommerce' ) || ! $this->should_show_site_mailer_hint() ) {
|
||||
if ( ! User::is_user_notice_viewed( 'send_app_forms_submissions_notice' ) ) {
|
||||
return Hints::should_show_hint( 'send_app_forms_submissions_notice' );
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class Submissions_Promotion_Menu_Item extends Base_Promotion_Template {
|
||||
return 'https://www.youtube-nocookie.com/embed/LNfnwba9C-8?si=JLHk3UAexnvTfU1a';
|
||||
}
|
||||
|
||||
public function get_cta_text() {
|
||||
public function get_cta_text(): string {
|
||||
if ( ! API::active_licence_has_feature( Form_Submissions_Component::NAME ) ) {
|
||||
return esc_html__( 'Upgrade Now', 'elementor-pro' );
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use ElementorPro\Modules\Forms\Submissions\AdminMenuItems\Submissions_Menu_Item;
|
||||
use ElementorPro\Modules\Forms\Submissions\AdminMenuItems\Submissions_Promotion_Menu_Item;
|
||||
use ElementorPro\Plugin;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\Base\Editor_One_Trait;
|
||||
use ElementorPro\Modules\Forms\Submissions\Database\Query;
|
||||
use ElementorPro\Modules\Forms\Submissions\Data\Controller;
|
||||
use ElementorPro\Modules\Forms\Submissions\Database\Migration;
|
||||
@@ -21,6 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Component extends Module_Base {
|
||||
use Editor_One_Trait;
|
||||
const NAME = 'form-submissions';
|
||||
const PAGE_ID = 'e-form-submissions';
|
||||
|
||||
@@ -187,6 +189,9 @@ class Component extends Module_Base {
|
||||
} );
|
||||
} else {
|
||||
add_action( 'elementor/admin/menu/register', function( Admin_Menu_Manager $admin_menu ) {
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
return;
|
||||
}
|
||||
$this->register_admin_menu_legacy( $admin_menu );
|
||||
}, 9 /* After "Settings" */ );
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\Forms\Submissions\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Third_Level_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\Forms\Submissions\AdminMenuItems\Submissions_Menu_Item;
|
||||
use ElementorPro\Modules\Forms\Submissions\Component;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Submissions_Menu_Item extends Submissions_Menu_Item implements Menu_Item_Third_Level_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 50;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Component::PAGE_ID;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_HOME_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Submissions', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::EDITOR_GROUP_ID;
|
||||
}
|
||||
|
||||
public function get_icon(): string {
|
||||
return 'send';
|
||||
}
|
||||
|
||||
public function has_children(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\Forms\Submissions\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Third_Level_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\Forms\Submissions\AdminMenuItems\Submissions_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\Forms\Submissions\Component;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Submissions_Promotion extends Submissions_Promotion_Menu_Item implements Menu_Item_Third_Level_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 50;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Component::PAGE_ID;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_HOME_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Submissions', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return '';
|
||||
}
|
||||
|
||||
public function get_capability(): string {
|
||||
return 'manage_options';
|
||||
}
|
||||
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_icon(): string {
|
||||
return 'send';
|
||||
}
|
||||
|
||||
public function has_children(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -823,8 +823,6 @@ class Form extends Form_Base {
|
||||
]
|
||||
);
|
||||
|
||||
$this->maybe_add_send_app_promotion_control();
|
||||
|
||||
$actions = Module::instance()->actions_registrar->get();
|
||||
|
||||
$actions_options = [];
|
||||
@@ -2760,36 +2758,4 @@ class Form extends Form_Base {
|
||||
public function get_group_name() {
|
||||
return 'forms';
|
||||
}
|
||||
|
||||
private function maybe_add_send_app_promotion_control(): void {
|
||||
if ( Hints::is_plugin_installed( 'send-app' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$notice_id = 'send_app_forms_actions_notice';
|
||||
if ( ! Hints::should_show_hint( $notice_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$notice_content = wp_kses( __( 'Turning leads into sales can be easy.<br />Let Send do the work', 'elementor-pro' ), [ 'br' => [] ] );
|
||||
|
||||
$this->add_control(
|
||||
'send_app_promo',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => Hints::get_notice_template( [
|
||||
'display' => ! Hints::is_dismissed( $notice_id ),
|
||||
'type' => 'info',
|
||||
'content' => $notice_content,
|
||||
'icon' => true,
|
||||
'dismissible' => $notice_id,
|
||||
'button_text' => __( 'Start for free', 'elementor-pro' ),
|
||||
'button_event' => $notice_id,
|
||||
'button_data' => [
|
||||
'action_url' => Hints::get_plugin_action_url( 'send-app' ),
|
||||
],
|
||||
], true ),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
130
modules/interactions/hooks.php
Normal file
130
modules/interactions/hooks.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\Interactions;
|
||||
|
||||
use ElementorPro\Plugin;
|
||||
use Elementor\Utils;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Hooks {
|
||||
const PACKAGES = [
|
||||
'editor-interactions-extended',
|
||||
];
|
||||
|
||||
public function register() {
|
||||
$this->register_packages()
|
||||
->register_pro_scripts()
|
||||
->replace_core_handlers();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function register_packages() {
|
||||
add_filter( 'elementor-pro/editor/v2/packages', function ( $packages ) {
|
||||
return array_merge( $packages, self::PACKAGES );
|
||||
} );
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function register_pro_scripts() {
|
||||
add_action( 'elementor/frontend/after_register_scripts', [ $this, 'register_frontend_scripts' ], 20 );
|
||||
add_action( 'elementor/preview/enqueue_scripts', [ $this, 'register_editor_scripts' ], 1 );
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function replace_core_handlers() {
|
||||
add_action( 'elementor/frontend/before_enqueue_scripts', [ $this, 'replace_frontend_handlers' ], 20 );
|
||||
|
||||
add_action( 'elementor/preview/enqueue_scripts', function() {
|
||||
$core_module = Plugin::elementor()->modules_manager->get_modules( 'e-interactions' );
|
||||
if ( $core_module && method_exists( $core_module, 'enqueue_preview_scripts' ) ) {
|
||||
remove_action( 'elementor/preview/enqueue_scripts', [ $core_module, 'enqueue_preview_scripts' ] );
|
||||
}
|
||||
}, 1 );
|
||||
|
||||
add_action( 'elementor/preview/enqueue_scripts', [ $this, 'replace_preview_handlers' ], 20 );
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function register_frontend_scripts() {
|
||||
$suffix = ( Utils::is_script_debug() || Utils::is_elementor_tests() ) ? '' : '.min';
|
||||
|
||||
wp_register_script(
|
||||
'elementor-interactions-pro',
|
||||
$this->get_js_assets_url( 'interactions-pro' ),
|
||||
[ 'motion-js' ],
|
||||
ELEMENTOR_PRO_VERSION,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
public function register_editor_scripts() {
|
||||
$suffix = ( Utils::is_script_debug() || Utils::is_elementor_tests() ) ? '' : '.min';
|
||||
|
||||
wp_register_script(
|
||||
'elementor-editor-interactions-pro',
|
||||
$this->get_js_assets_url( 'editor-interactions-pro' ),
|
||||
[ 'motion-js' ],
|
||||
ELEMENTOR_PRO_VERSION,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
public function replace_frontend_handlers() {
|
||||
wp_dequeue_script( 'elementor-interactions' );
|
||||
wp_deregister_script( 'elementor-interactions' );
|
||||
|
||||
wp_enqueue_script( 'elementor-interactions-pro' );
|
||||
|
||||
$config = $this->get_config();
|
||||
wp_localize_script(
|
||||
'elementor-interactions-pro',
|
||||
'ElementorInteractionsConfig',
|
||||
$config
|
||||
);
|
||||
}
|
||||
|
||||
public function replace_preview_handlers() {
|
||||
wp_dequeue_script( 'elementor-editor-interactions' );
|
||||
wp_deregister_script( 'elementor-editor-interactions' );
|
||||
|
||||
wp_enqueue_script( 'elementor-editor-interactions-pro' );
|
||||
|
||||
$config = $this->get_config();
|
||||
wp_localize_script(
|
||||
'elementor-editor-interactions-pro',
|
||||
'ElementorInteractionsConfig',
|
||||
$config
|
||||
);
|
||||
}
|
||||
|
||||
private function get_config() {
|
||||
$interactions_module = Plugin::elementor()->modules_manager->get_modules( 'e-interactions' );
|
||||
|
||||
if ( $interactions_module && method_exists( $interactions_module, 'get_config' ) ) {
|
||||
return $interactions_module->get_config();
|
||||
}
|
||||
|
||||
return [
|
||||
'constants' => [
|
||||
'defaultDuration' => 300,
|
||||
'defaultDelay' => 0,
|
||||
'slideDistance' => 100,
|
||||
'scaleStart' => 0,
|
||||
'easing' => 'linear',
|
||||
],
|
||||
'animationOptions' => [],
|
||||
];
|
||||
}
|
||||
|
||||
private function get_js_assets_url( $filename ) {
|
||||
$suffix = ( Utils::is_script_debug() || Utils::is_elementor_tests() ) ? '' : '.min';
|
||||
return ELEMENTOR_PRO_URL . 'assets/js/' . $filename . $suffix . '.js';
|
||||
}
|
||||
}
|
||||
54
modules/interactions/module.php
Normal file
54
modules/interactions/module.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\Interactions;
|
||||
|
||||
use ElementorPro\Plugin;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
|
||||
use Elementor\Modules\Interactions\Module as InteractionsModule;
|
||||
use Elementor\Core\Experiments\Manager as ExperimentsManager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
const MODULE_NAME = 'e-interactions';
|
||||
const EXPERIMENT_NAME = 'e_pro_interactions';
|
||||
|
||||
public function get_name() {
|
||||
return self::MODULE_NAME;
|
||||
}
|
||||
|
||||
public static function get_experimental_data(): array {
|
||||
return [
|
||||
'name' => self::EXPERIMENT_NAME,
|
||||
'title' => esc_html__( 'Pro Interactions', 'elementor-pro' ),
|
||||
'description' => esc_html__( 'Enhanced interactions with replay support. Note: This feature requires both the "Atomic Widgets" and "Interactions" experiments to be enabled.', 'elementor-pro' ),
|
||||
'hidden' => true,
|
||||
'default' => ExperimentsManager::STATE_INACTIVE,
|
||||
'release_status' => ExperimentsManager::RELEASE_STATUS_DEV,
|
||||
];
|
||||
}
|
||||
|
||||
private function hooks() {
|
||||
return new Hooks();
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
if ( ! $this->is_experiment_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->hooks()->register();
|
||||
}
|
||||
|
||||
private function is_experiment_active(): bool {
|
||||
return class_exists( 'Elementor\\Modules\\Interactions\\Module' )
|
||||
&& Plugin::elementor()->experiments->is_feature_active( self::EXPERIMENT_NAME )
|
||||
&& Plugin::elementor()->experiments->is_feature_active( AtomicWidgetsModule::EXPERIMENT_NAME )
|
||||
&& Plugin::elementor()->experiments->is_feature_active( InteractionsModule::EXPERIMENT_NAME );
|
||||
}
|
||||
}
|
||||
@@ -28,10 +28,10 @@ class Shortcode {
|
||||
}
|
||||
|
||||
printf(
|
||||
'<label class="screen-reader-text" for="%1$s">%2$s</label><input class="elementor-shortcode-input" type="text" id="%1$s" readonly onfocus="this.select()" value="%3$s" />',
|
||||
'<label class="screen-reader-text" for="%1$s">%2$s</label><textarea class="elementor-shortcode-textarea" id="%1$s" readonly rows="1" onfocus="this.select()">%3$s</textarea>',
|
||||
sprintf(
|
||||
/* translators: %s: Template ID. */
|
||||
esc_attr( 'elementor-templte-%s-shortcode' ),
|
||||
esc_attr( 'elementor-template-%s-shortcode' ),
|
||||
$post_id // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
),
|
||||
sprintf(
|
||||
@@ -41,7 +41,7 @@ class Shortcode {
|
||||
),
|
||||
sprintf(
|
||||
/* translators: %s: Shortcode, %d: Template ID. */
|
||||
esc_attr( '[%s id="%d"]' ),
|
||||
esc_textarea( '[%s id="%d"]' ),
|
||||
self::SHORTCODE, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
$post_id // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
)
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
|
||||
namespace ElementorPro\Modules\Notes;
|
||||
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
|
||||
use Elementor\Settings;
|
||||
use ElementorPro\Base\Editor_One_Trait;
|
||||
use ElementorPro\Modules\Notes\Database\Models\Note;
|
||||
use ElementorPro\Modules\Notes\EditorOneMenuItems\Editor_One_Notes_Proxy_Menu_Item;
|
||||
use ElementorPro\Modules\Notes\User\Capabilities;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -16,18 +19,23 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
* before accessing a Note (since Notes aren't available for unauthorized users).
|
||||
*/
|
||||
class Admin_Page {
|
||||
use Editor_One_Trait;
|
||||
|
||||
const PAGE_ID = 'elementor-pro-notes-proxy';
|
||||
|
||||
/**
|
||||
* Register actions and hooks.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
const PRIORITY_AFTER_ELEMENTOR = 206;
|
||||
|
||||
public function register() {
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
|
||||
$menu_data_provider->register_menu( new Editor_One_Notes_Proxy_Menu_Item( $this ) );
|
||||
} );
|
||||
return;
|
||||
}
|
||||
|
||||
add_action( 'admin_menu', function () {
|
||||
$this->register_admin_menu();
|
||||
}, 206 ); // After Elementor.
|
||||
}, static::PRIORITY_AFTER_ELEMENTOR );
|
||||
|
||||
add_action( 'admin_head', function () {
|
||||
$this->hide_menu_item();
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\Notes\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Core\Admin\Menu\Interfaces\Admin_Menu_Item_With_Page;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\Notes\Admin_Page;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Notes_Proxy_Menu_Item implements Menu_Item_Interface, Admin_Menu_Item_With_Page {
|
||||
|
||||
private Admin_Page $admin_page;
|
||||
|
||||
public function __construct( Admin_Page $admin_page ) {
|
||||
$this->admin_page = $admin_page;
|
||||
}
|
||||
|
||||
public function get_page_title(): string {
|
||||
return esc_html__( 'Notes Proxy', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_capability(): string {
|
||||
return 'read';
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Notes Proxy', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function is_visible(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get_position(): int {
|
||||
return 999;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Admin_Page::PAGE_ID;
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::SYSTEM_GROUP_ID;
|
||||
}
|
||||
|
||||
public function render(): void {
|
||||
$this->admin_page->on_page_load();
|
||||
}
|
||||
}
|
||||
@@ -10,23 +10,23 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Popups_Menu_Item implements Admin_Menu_Item {
|
||||
public function get_capability() {
|
||||
public function get_capability(): string {
|
||||
return 'publish_posts';
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Popups', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Source_Local::ADMIN_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
public function get_position(): ?int {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function is_visible() {
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,15 +14,15 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
||||
class Popups_Promotion_Menu_Item extends Base_Promotion_Item {
|
||||
|
||||
public function get_name() {
|
||||
public function get_name(): string {
|
||||
return 'popups';
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
public function get_position(): ?int {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get_cta_text() {
|
||||
public function get_cta_text(): string {
|
||||
if ( ! API::active_licence_has_feature( Popup_Module::DOCUMENT_TYPE ) ) {
|
||||
return esc_html__( 'Upgrade Now', 'elementor-pro' );
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class Popups_Promotion_Menu_Item extends Base_Promotion_Item {
|
||||
: esc_html__( 'Connect & Activate', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_cta_url() {
|
||||
public function get_cta_url(): string {
|
||||
if ( ! API::active_licence_has_feature( Popup_Module::DOCUMENT_TYPE ) ) {
|
||||
$upgrade_url = 'https://go.elementor.com/go-pro-advanced-popups/';
|
||||
|
||||
@@ -52,23 +52,23 @@ class Popups_Promotion_Menu_Item extends Base_Promotion_Item {
|
||||
: $connect_url;
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Source_Local::ADMIN_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Popups', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_page_title() {
|
||||
public function get_page_title(): string {
|
||||
return esc_html__( 'Popups', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_promotion_title() {
|
||||
public function get_promotion_title(): string {
|
||||
return esc_html__( 'Get Popup Builder', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_promotion_description() {
|
||||
public function get_promotion_description(): string {
|
||||
return esc_html__(
|
||||
"Create custom designed Popups. Use advanced display conditions and triggers to display the right popup, to the right visitor, at the right time and maximize conversions.",
|
||||
'elementor-pro'
|
||||
|
||||
@@ -28,8 +28,6 @@ class Triggers extends Base {
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section( 'triggers' );
|
||||
|
||||
$this->maybe_add_send_app_promotion_control();
|
||||
|
||||
$this->start_settings_group( 'page_load', esc_html__( 'On Page Load', 'elementor-pro' ) );
|
||||
|
||||
$this->add_settings_group_control(
|
||||
@@ -142,59 +140,4 @@ class Triggers extends Base {
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
private function get_send_app_notice_template( $notice_id, $notice_content ): string {
|
||||
if ( Hints::is_dismissed( $notice_id ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$action_url = Hints::get_plugin_action_url( 'send-app' );
|
||||
$button_data = wp_json_encode( [ 'action_url' => $action_url ] );
|
||||
|
||||
return '<div class="elementor-control-notice elementor-control-notice-type-info">
|
||||
<div class="elementor-control-notice-icon">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.25 9H3M9 2.25V3M15 9H15.75M4.2 4.2L4.725 4.725M13.8 4.2L13.275 4.725M7.27496 12.75H10.725M6.75 12C6.12035 11.5278 5.65525 10.8694 5.42057 10.1181C5.1859 9.36687 5.19355 8.56082 5.44244 7.81415C5.69133 7.06748 6.16884 6.41804 6.80734 5.95784C7.44583 5.49764 8.21294 5.25 9 5.25C9.78706 5.25 10.5542 5.49764 11.1927 5.95784C11.8312 6.41804 12.3087 7.06748 12.5576 7.81415C12.8065 8.56082 12.8141 9.36687 12.5794 10.1181C12.3448 10.8694 11.8796 11.5278 11.25 12C10.9572 12.2899 10.7367 12.6446 10.6064 13.0355C10.4761 13.4264 10.4397 13.8424 10.5 14.25C10.5 14.6478 10.342 15.0294 10.0607 15.3107C9.77936 15.592 9.39782 15.75 9 15.75C8.60218 15.75 8.22064 15.592 7.93934 15.3107C7.65804 15.0294 7.5 14.6478 7.5 14.25C7.56034 13.8424 7.52389 13.4264 7.3936 13.0355C7.2633 12.6446 7.04282 12.2899 6.75 12Z" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="elementor-control-notice-main">
|
||||
<div class="elementor-control-notice-main-content">' . $notice_content . '</div>
|
||||
<div class="elementor-control-notice-main-actions">
|
||||
<button type="button" class="e-btn e-info e-btn-1" data-event="' . esc_attr( $notice_id ) . '" data-settings="' . esc_attr( $button_data ) . '" onclick="window.open(\'' . esc_url( $action_url ) . '\', \'_blank\');">
|
||||
' . __( 'Install Send', 'elementor-pro' ) . '
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button class="elementor-control-notice-dismiss tooltip-target" data-event="' . esc_attr( $notice_id ) . '" data-tooltip="' . esc_attr__( 'Don\'t show again.', 'elementor-pro' ) . '" aria-label="' . esc_attr__( 'Don\'t show again.', 'elementor-pro' ) . '" onclick="this.closest(\'.elementor-control-notice\').style.display=\'none\'; elementorCommon.ajax.addRequest(\'dismissed_editor_notices\', {data: {dismissId: \'' . esc_js( $notice_id ) . '\'}}); return false;">
|
||||
<i class="eicon eicon-close" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>';
|
||||
}
|
||||
|
||||
private function maybe_add_send_app_promotion_control(): void {
|
||||
if ( Hints::is_plugin_installed( 'send-app' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$notice_id = 'send_app_forms_triggers_notice';
|
||||
if ( ! Hints::should_show_hint( $notice_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$notice_content = wp_kses(
|
||||
__( '<strong>Turn popup clicks into sales with Send.</strong> Trigger automated emails the moment visitors engage.', 'elementor-pro' ),
|
||||
[
|
||||
'br' => [],
|
||||
'strong' => [],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'send_app_promo',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => $this->get_send_app_notice_template( $notice_id, $notice_content ),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\Popup\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\Popup\AdminMenuItems\Popups_Menu_Item;
|
||||
use ElementorPro\Modules\Popup\Module;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Popups_Menu_Item extends Popups_Menu_Item implements Menu_Item_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 70;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Module::instance()->get_admin_url( true );
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Popups', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::TEMPLATES_GROUP_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\Popup\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use ElementorPro\Modules\Popup\AdminMenuItems\Popups_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\Popup\Module;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Popups_Promotion extends Popups_Promotion_Menu_Item implements Menu_Item_Interface {
|
||||
|
||||
public function get_position(): int {
|
||||
return 70;
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return Module::PROMOTION_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Popups', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::TEMPLATES_GROUP_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,17 @@ use Elementor\Core\Base\Document as DocumentBase;
|
||||
use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
|
||||
use Elementor\Core\Documents_Manager;
|
||||
use Elementor\Core\DynamicTags\Manager as DynamicTagsManager;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
|
||||
use Elementor\TemplateLibrary\Source_Local;
|
||||
use ElementorPro\Base\Editor_One_Trait;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\Core\Behaviors\Feature_Lock;
|
||||
use ElementorPro\Core\Utils;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\Modules\Popup\AdminMenuItems\Popups_Menu_Item;
|
||||
use ElementorPro\Modules\Popup\AdminMenuItems\Popups_Promotion_Menu_Item;
|
||||
use ElementorPro\Modules\Popup\EditorOneMenuItems\Editor_One_Popups_Menu_Item;
|
||||
use ElementorPro\Modules\Popup\EditorOneMenuItems\Editor_One_Popups_Promotion;
|
||||
use ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager;
|
||||
use ElementorPro\Plugin;
|
||||
|
||||
@@ -22,6 +26,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
use Editor_One_Trait;
|
||||
|
||||
const DOCUMENT_TYPE = 'popup';
|
||||
|
||||
const PROMOTION_MENU_SLUG = 'e-popups';
|
||||
@@ -31,6 +37,8 @@ class Module extends Module_Base {
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
add_action( 'admin_init', [ $this, 'redirect_legacy_popups_promotion_url' ] );
|
||||
|
||||
add_action( 'elementor/frontend/after_register_styles', [ $this, 'register_frontend_styles' ] );
|
||||
add_action( 'elementor/preview/enqueue_styles', [ $this, 'enqueue_preview_styles' ] );
|
||||
|
||||
@@ -55,6 +63,10 @@ class Module extends Module_Base {
|
||||
} );
|
||||
} else {
|
||||
add_action( 'elementor/admin/menu/register', function( Admin_Menu_Manager $admin_menu_manager ) {
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->can_use_popups() ) {
|
||||
$admin_menu_manager->register( $this->get_admin_url( true ), new Popups_Menu_Item() );
|
||||
} else {
|
||||
@@ -66,6 +78,14 @@ class Module extends Module_Base {
|
||||
add_action( 'admin_menu', function() {
|
||||
$this->register_admin_menu_legacy();
|
||||
}, 21 /* After `Admin_Menu_Manager` */ );
|
||||
|
||||
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
|
||||
if ( $this->can_use_popups() ) {
|
||||
$menu_data_provider->register_menu( new Editor_One_Popups_Menu_Item() );
|
||||
} else {
|
||||
$menu_data_provider->register_menu( new Editor_One_Popups_Promotion() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
add_filter( 'elementor/finder/categories', [ $this, 'add_finder_items' ] );
|
||||
@@ -83,6 +103,34 @@ class Module extends Module_Base {
|
||||
);
|
||||
}
|
||||
|
||||
public function redirect_legacy_popups_promotion_url(): void {
|
||||
$page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
|
||||
|
||||
if ( static::PROMOTION_MENU_SLUG !== $page ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->can_use_popups() ) {
|
||||
wp_safe_redirect( $this->get_admin_url() );
|
||||
exit;
|
||||
}
|
||||
|
||||
global $pagenow;
|
||||
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
if ( 'edit.php' !== $pagenow ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( Source_Local::CPT !== filter_input( INPUT_GET, 'post_type', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_safe_redirect( admin_url( 'admin.php?page=' . static::PROMOTION_MENU_SLUG ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
public function enqueue_preview_styles() {
|
||||
wp_enqueue_style( 'e-popup' );
|
||||
}
|
||||
@@ -241,7 +289,7 @@ class Module extends Module_Base {
|
||||
return $categories;
|
||||
}
|
||||
|
||||
private function get_admin_url( $relative = false ) {
|
||||
public function get_admin_url( $relative = false ) {
|
||||
$base_url = Source_Local::ADMIN_MENU_SLUG;
|
||||
if ( ! $relative ) {
|
||||
$base_url = admin_url( $base_url );
|
||||
|
||||
@@ -9,23 +9,23 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Theme_Builder_Menu_Item implements Admin_Menu_Item {
|
||||
public function get_capability() {
|
||||
public function get_capability(): string {
|
||||
return 'publish_posts';
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Theme Builder', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Source_Local::ADMIN_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function is_visible() {
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_position() {
|
||||
return null;
|
||||
public function get_position(): ?int {
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\ThemeBuilder\EditorOneMenuItems;
|
||||
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Third_Level_Interface;
|
||||
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_With_Custom_Url_Interface;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Editor_One_Theme_Builder_Menu_Item implements Menu_Item_Third_Level_Interface, Menu_Item_With_Custom_Url_Interface {
|
||||
public function get_position(): int {
|
||||
return 85; // After apps (Image Optimization=2, Accessibility=80), before Submissions (100)
|
||||
}
|
||||
|
||||
public function get_slug(): string {
|
||||
return 'elementor-theme-builder';
|
||||
}
|
||||
|
||||
public function get_parent_slug(): string {
|
||||
return Menu_Config::ELEMENTOR_HOME_MENU_SLUG;
|
||||
}
|
||||
|
||||
public function get_label(): string {
|
||||
return esc_html__( 'Theme Builder', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_group_id(): string {
|
||||
return Menu_Config::EDITOR_GROUP_ID;
|
||||
}
|
||||
|
||||
public function get_capability(): string {
|
||||
return 'publish_posts';
|
||||
}
|
||||
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_icon(): string {
|
||||
return 'build';
|
||||
}
|
||||
|
||||
public function has_children(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get_menu_url(): string {
|
||||
$return_to = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ?? '' ) );
|
||||
|
||||
return add_query_arg(
|
||||
[
|
||||
'return_to' => urlencode( $return_to ),
|
||||
],
|
||||
Plugin::instance()->app->get_base_url()
|
||||
) . '#/site-editor';
|
||||
}
|
||||
|
||||
public function get_page_title(): string {
|
||||
return esc_html__( 'Theme Builder', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function render(): void {
|
||||
}
|
||||
}
|
||||
@@ -7,14 +7,17 @@ use Elementor\Core\Admin\Menu\Admin_Menu_Manager;
|
||||
use Elementor\Core\Admin\Menu\Main as MainMenu;
|
||||
use Elementor\Core\App\App;
|
||||
use Elementor\Core\Base\Document;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Config;
|
||||
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
|
||||
use Elementor\TemplateLibrary\Source_Local;
|
||||
use Elementor\App\Modules\ImportExportCustomization\Utils as ImportExportCustomizationUtils;
|
||||
use ElementorPro\Base\Editor_One_Trait;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\Core\Utils;
|
||||
use ElementorPro\Modules\ThemeBuilder\AdminMenuItems\Theme_Builder_Menu_Item;
|
||||
use ElementorPro\Modules\ThemeBuilder\Classes;
|
||||
use ElementorPro\Modules\ThemeBuilder\Documents\Single;
|
||||
use ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document;
|
||||
use ElementorPro\Modules\ThemeBuilder\EditorOneMenuItems\Editor_One_Theme_Builder_Menu_Item;
|
||||
use ElementorPro\Modules\ThemeBuilder\ImportExportCustomization;
|
||||
use ElementorPro\Plugin;
|
||||
|
||||
@@ -23,10 +26,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
use Editor_One_Trait;
|
||||
|
||||
const ADMIN_LIBRARY_TAB_GROUP = 'theme';
|
||||
|
||||
const ADMIN_MENU_PRIORITY = 15;
|
||||
const THEME_BUILDER_MENU_PRIORITY_BEFORE_SUBMISSIONS = 5;
|
||||
|
||||
public static function is_preview() {
|
||||
return Plugin::elementor()->preview->is_preview_mode() || is_preview();
|
||||
@@ -467,6 +472,10 @@ class Module extends Module_Base {
|
||||
} );
|
||||
} else {
|
||||
add_action( 'elementor/admin/menu/register', function ( Admin_Menu_Manager $admin_menu ) {
|
||||
if ( $this->is_editor_one_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->register_admin_menu_legacy( $admin_menu );
|
||||
}, static::ADMIN_MENU_PRIORITY /* After "Popups" */ );
|
||||
|
||||
@@ -484,6 +493,10 @@ class Module extends Module_Base {
|
||||
$this->get_admin_templates_url( true )
|
||||
);
|
||||
}, 22 /* After core promotion menu */ );
|
||||
|
||||
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
|
||||
$menu_data_provider->register_menu( new Editor_One_Theme_Builder_Menu_Item() );
|
||||
}, static::THEME_BUILDER_MENU_PRIORITY_BEFORE_SUBMISSIONS );
|
||||
}
|
||||
|
||||
add_filter( 'elementor/template-library/create_new_dialog_types', [ $this, 'create_new_dialog_types' ] );
|
||||
|
||||
@@ -13,35 +13,35 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
||||
abstract class Base_Promotion_Item implements Promotion_Menu_Item {
|
||||
|
||||
public function get_name() {
|
||||
public function get_name(): string {
|
||||
return 'base_promotion';
|
||||
}
|
||||
|
||||
public function is_visible() {
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Settings::PAGE_ID;
|
||||
}
|
||||
|
||||
public function get_capability() {
|
||||
public function get_capability(): string {
|
||||
return 'manage_options';
|
||||
}
|
||||
|
||||
public function get_cta_text() {
|
||||
public function get_cta_text(): string {
|
||||
return esc_html__( 'Upgrade Now', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_image_url() {
|
||||
public function get_image_url(): string {
|
||||
return ELEMENTOR_ASSETS_URL . 'images/go-pro-wp-dashboard.svg';
|
||||
}
|
||||
|
||||
public function get_promotion_description() {
|
||||
public function get_promotion_description(): string {
|
||||
return '';
|
||||
}
|
||||
|
||||
public function render() {
|
||||
public function render(): void {
|
||||
$config = [
|
||||
'title' => $this->get_promotion_title(),
|
||||
'description' => $this->get_promotion_description(),
|
||||
|
||||
@@ -22,19 +22,19 @@ abstract class Base_Promotion_Template implements Admin_Menu_Item_With_Page {
|
||||
|
||||
abstract protected function get_video_url():string;
|
||||
|
||||
public function is_visible() {
|
||||
public function is_visible(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_parent_slug() {
|
||||
public function get_parent_slug(): string {
|
||||
return Settings::PAGE_ID;
|
||||
}
|
||||
|
||||
public function get_capability() {
|
||||
public function get_capability(): string {
|
||||
return 'manage_options';
|
||||
}
|
||||
|
||||
protected function get_cta_text() {
|
||||
protected function get_cta_text(): string {
|
||||
return esc_html__( 'Upgrade Now', 'elementor-pro' );
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ abstract class Base_Promotion_Template implements Admin_Menu_Item_With_Page {
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
public function render() {
|
||||
public function render(): void {
|
||||
$promotion_data = $this->get_promotion_data();
|
||||
?>
|
||||
<div class="e-feature-promotion">
|
||||
|
||||
@@ -8,6 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
// TODO: deprecate in 3.36
|
||||
class Size_Variable_Prop_Type extends String_Prop_Type {
|
||||
public static function get_key(): string {
|
||||
return 'global-size-variable';
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\Woocommerce\Traits;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use ElementorPro\core\utils\Hints;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
trait Send_App_Plg_Trait {
|
||||
public function maybe_add_send_app_promotion_control( $widget ): void {
|
||||
if ( Hints::is_plugin_installed( 'send-app' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$notice_id = 'send_app_wc_widgets_notice';
|
||||
if ( ! Hints::should_show_hint( $notice_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$notice_content = esc_html__( 'Built your store? Now make it grow. Start with Send today.', 'elementor-pro' );
|
||||
|
||||
$widget->add_control(
|
||||
'send_app_promo',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => Hints::get_notice_template( [
|
||||
'display' => ! Hints::is_dismissed( $notice_id ),
|
||||
'type' => 'info',
|
||||
'content' => $notice_content,
|
||||
'icon' => true,
|
||||
'dismissible' => $notice_id,
|
||||
'button_text' => __( 'Install Plugin', 'elementor-pro' ),
|
||||
'button_event' => $notice_id,
|
||||
'button_data' => [
|
||||
'action_url' => Hints::get_plugin_action_url( 'send-app' ),
|
||||
],
|
||||
], true ),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ use ElementorPro\Core\Utils;
|
||||
use ElementorPro\Core\Utils\Hints;
|
||||
use ElementorPro\Modules\QueryControl\Module;
|
||||
use ElementorPro\Modules\Woocommerce\Traits\Product_Id_Trait;
|
||||
use ElementorPro\Modules\Woocommerce\Traits\Send_App_Plg_Trait;
|
||||
use ElementorPro\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
@@ -18,7 +17,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
class Add_To_Cart extends Widget_Button {
|
||||
use Base_Widget_Trait;
|
||||
use Product_Id_Trait;
|
||||
use Send_App_Plg_Trait;
|
||||
|
||||
public function get_name() {
|
||||
return 'wc-add-to-cart';
|
||||
@@ -76,8 +74,6 @@ class Add_To_Cart extends Widget_Button {
|
||||
]
|
||||
);
|
||||
|
||||
$this->maybe_add_send_app_promotion_control( $this );
|
||||
|
||||
$this->add_control(
|
||||
'product_id',
|
||||
[
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
namespace ElementorPro\Modules\Woocommerce\Widgets;
|
||||
|
||||
use ElementorPro\Modules\Woocommerce\Module;
|
||||
use ElementorPro\Modules\Woocommerce\Traits\Send_App_Plg_Trait;
|
||||
use ElementorPro\Plugin;
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
@@ -19,7 +18,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Cart extends Base_Widget {
|
||||
use Send_App_Plg_Trait;
|
||||
|
||||
public function get_name() {
|
||||
return 'woocommerce-cart';
|
||||
@@ -60,8 +58,6 @@ class Cart extends Base_Widget {
|
||||
]
|
||||
);
|
||||
|
||||
$this->maybe_add_send_app_promotion_control( $this );
|
||||
|
||||
$this->add_control(
|
||||
'cart_layout',
|
||||
[
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\Woocommerce\Widgets;
|
||||
|
||||
use ElementorPro\Modules\Woocommerce\Traits\Send_App_Plg_Trait;
|
||||
use ElementorPro\Plugin;
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
@@ -17,7 +16,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Checkout extends Base_Widget {
|
||||
use Send_App_Plg_Trait;
|
||||
private $reformatted_form_fields;
|
||||
|
||||
public function get_name() {
|
||||
@@ -64,8 +62,6 @@ class Checkout extends Base_Widget {
|
||||
]
|
||||
);
|
||||
|
||||
$this->maybe_add_send_app_promotion_control( $this );
|
||||
|
||||
$this->add_control(
|
||||
'checkout_layout',
|
||||
[
|
||||
|
||||
@@ -5,7 +5,6 @@ use Elementor\Controls_Manager;
|
||||
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use Elementor\Group_Control_Border;
|
||||
use Elementor\Group_Control_Typography;
|
||||
use ElementorPro\Modules\Woocommerce\Traits\Send_App_Plg_Trait;
|
||||
use ElementorPro\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
@@ -13,7 +12,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
class Product_Add_To_Cart extends Base_Widget {
|
||||
use Send_App_Plg_Trait;
|
||||
|
||||
public function get_name() {
|
||||
return 'woocommerce-product-add-to-cart';
|
||||
@@ -194,8 +192,6 @@ class Product_Add_To_Cart extends Base_Widget {
|
||||
]
|
||||
);
|
||||
|
||||
$this->maybe_add_send_app_promotion_control( $this );
|
||||
|
||||
$this->add_control(
|
||||
'layout',
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user