Update elementor pro
This commit is contained in:
@@ -312,20 +312,25 @@ class Animated_Headline extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-headline' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -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 Elementor 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.
|
||||
*
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 }}
|
||||
/>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\AtomicWidgets;
|
||||
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\Plugin;
|
||||
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
|
||||
use Elementor\Modules\AtomicWidgets\PropsResolver\Transformers_Registry;
|
||||
use ElementorPro\Modules\AtomicWidgets\PropTypes\Display_Conditions\Display_Conditions_Prop_Type;
|
||||
use ElementorPro\Modules\AtomicWidgets\PropTypes\Display_Conditions\Condition_Group_Prop_Type;
|
||||
use ElementorPro\Modules\AtomicWidgets\Transformers\Display_Conditions as Display_Conditions_Transformer;
|
||||
use ElementorPro\Modules\AtomicWidgets\Transformers\Condition_Group as Condition_Group_Transformer;
|
||||
use ElementorPro\License\API;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'atomic';
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
if ( ! Plugin::elementor()->experiments->is_feature_active( AtomicWidgetsModule::EXPERIMENT_NAME ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_filter(
|
||||
'elementor/atomic-widgets/props-schema',
|
||||
fn( $schema ) => $this->inject_props_schema( $schema ),
|
||||
10,
|
||||
1
|
||||
);
|
||||
|
||||
add_action(
|
||||
'elementor/atomic-widgets/settings/transformers/register',
|
||||
fn ( $transformers ) => $this->register_settings_transformers( $transformers ),
|
||||
);
|
||||
|
||||
add_filter(
|
||||
'elementor/atomic_widgets/editor_data/element_styles',
|
||||
fn( $styles_without_custom_css, $styles ) => $this->get_license_based_custom_css_value( $styles_without_custom_css, $styles ),
|
||||
10,
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
private function inject_props_schema( $schema ) {
|
||||
$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;
|
||||
}
|
||||
|
||||
private function register_settings_transformers( Transformers_Registry $transformers ): Transformers_Registry {
|
||||
$transformers->register( Display_Conditions_Prop_Type::get_key(), new Display_Conditions_Transformer() );
|
||||
$transformers->register( Condition_Group_Prop_Type::get_key(), new Condition_Group_Transformer() );
|
||||
|
||||
return $transformers;
|
||||
}
|
||||
|
||||
private function get_license_based_custom_css_value( $styles_without_custom_css, $styles ) {
|
||||
if ( $this->has_custom_css_feature_in_license() ) {
|
||||
return $styles;
|
||||
}
|
||||
|
||||
return $styles_without_custom_css;
|
||||
}
|
||||
|
||||
private function has_custom_css_feature_in_license() {
|
||||
return API::is_license_active() && API::is_licence_has_feature( 'atomic-custom-css' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AtomicWidgets\PropTypes\Display_Conditions;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Base\Array_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Contracts\Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Condition_Group_Prop_Type extends Array_Prop_Type {
|
||||
public static function get_key(): string {
|
||||
return 'condition-group';
|
||||
}
|
||||
|
||||
protected function define_item_type(): Prop_Type {
|
||||
return String_Prop_Type::make();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AtomicWidgets\PropTypes\Display_Conditions;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Base\Array_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Contracts\Prop_Type;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Display_Conditions_Prop_Type extends Array_Prop_Type {
|
||||
public static function get_key(): string {
|
||||
return 'display-conditions';
|
||||
}
|
||||
|
||||
protected function define_item_type(): Prop_Type {
|
||||
return Condition_Group_Prop_Type::make();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AtomicWidgets\PropTypes\Display_Conditions;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Base\Object_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Page_Title_Condition_Prop_Type extends Object_Prop_Type {
|
||||
|
||||
public static function get_key(): string {
|
||||
return 'page-title-condition';
|
||||
}
|
||||
|
||||
protected function validate_value( $value ): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function define_shape(): array {
|
||||
return [
|
||||
'operator' => String_Prop_Type::make()
|
||||
->enum( [ '==', '!=' ] )
|
||||
->default( '==' )
|
||||
->required(),
|
||||
'value' => String_Prop_Type::make()
|
||||
->required(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AtomicWidgets\PropTypes\Display_Conditions;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Base\Object_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Date_Time_Prop_Type;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Time_Of_Day_Condition_Prop_Type extends Object_Prop_Type {
|
||||
|
||||
public static function get_key(): string {
|
||||
return 'time-of-day-condition';
|
||||
}
|
||||
|
||||
protected function validate_value( $value ): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function define_shape(): array {
|
||||
return [
|
||||
'operator' => String_Prop_Type::make()
|
||||
->enum( [ '==', '!=', '>', '<', '>=', '<=' ] )
|
||||
->default( '==' )
|
||||
->required(),
|
||||
'server_time' => Boolean_Prop_Type::make()
|
||||
->default( true )
|
||||
->required(),
|
||||
'value' => Date_Time_Prop_Type::make()
|
||||
->required(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AtomicWidgets\Transformers;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\PropsResolver\Props_Resolver_Context;
|
||||
use Elementor\Modules\AtomicWidgets\PropsResolver\Transformer_Base;
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Condition_Group extends Transformer_Base {
|
||||
public function transform( $conditions, Props_Resolver_Context $context ) {
|
||||
if ( ! is_array( $conditions ) || empty( $conditions ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return array_map( function( $condition ) {
|
||||
return json_decode( $condition, true );
|
||||
}, $conditions );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\AtomicWidgets\Transformers;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\PropsResolver\Props_Resolver_Context;
|
||||
use Elementor\Modules\AtomicWidgets\PropsResolver\Render_Props_Resolver;
|
||||
use Elementor\Modules\AtomicWidgets\PropsResolver\Transformer_Base;
|
||||
use ElementorPro\Modules\AtomicWidgets\PropTypes\Display_Conditions\Display_Conditions_Prop_Type;
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Display_Conditions extends Transformer_Base {
|
||||
public function transform( $value, Props_Resolver_Context $context ) {
|
||||
return ! is_array( $value ) || empty( $value )
|
||||
? []
|
||||
: $value;
|
||||
}
|
||||
|
||||
public static function extract_from_settings( $settings ) {
|
||||
$prop_key = Display_Conditions_Prop_Type::get_key();
|
||||
|
||||
if ( ! isset( $settings[ $prop_key ]['value'] ) ) {
|
||||
return '[]';
|
||||
}
|
||||
|
||||
$params = self::create_params_from_settings( $settings );
|
||||
$resolved = Render_Props_Resolver::for_settings()->resolve( ...$params );
|
||||
|
||||
return [ json_encode( $resolved[ $prop_key ] ) ];
|
||||
}
|
||||
|
||||
private static function create_params_from_settings( $settings ) {
|
||||
$prop_key = Display_Conditions_Prop_Type::get_key();
|
||||
$prop_type = Display_Conditions_Prop_Type::make();
|
||||
$value = $settings[ $prop_key ];
|
||||
$schema = [
|
||||
$prop_key => $prop_type,
|
||||
];
|
||||
$props = [
|
||||
$prop_key => $value,
|
||||
];
|
||||
|
||||
return [ $schema, $props ];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\Attributes\Controls;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Repeatable_Control as Core_Repeatable_Control;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Repeatable_Attributes_Control extends Core_Repeatable_Control {
|
||||
private ?array $add_item_tooltip_props = null;
|
||||
|
||||
public function set_addItemTooltipProps( array $props ): self {
|
||||
$this->add_item_tooltip_props = $props;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_props(): array {
|
||||
$props = parent::get_props();
|
||||
|
||||
if ( null !== $this->add_item_tooltip_props ) {
|
||||
$props['addItemTooltipProps'] = (object) $this->add_item_tooltip_props;
|
||||
}
|
||||
|
||||
return $props;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@ namespace ElementorPro\Modules\Attributes;
|
||||
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\License\API;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Types\Repeatable_Control;
|
||||
use ElementorPro\Modules\Attributes\Controls\Repeatable_Attributes_Control;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Section;
|
||||
use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
|
||||
use ElementorPro\Modules\Attributes\PropsResolver\Transformers\Settings\Pro_Attributes_Transformer;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
@@ -20,10 +22,26 @@ class Module extends Module_Base {
|
||||
return API::is_licence_has_feature( 'atomic-custom-attributes' );
|
||||
}
|
||||
|
||||
private function is_license_expired() {
|
||||
return API::is_license_expired();
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
if ( $this->is_attributes_active() ) {
|
||||
if ( $this->is_attributes_active() || $this->is_license_expired() ) {
|
||||
add_action(
|
||||
'elementor/atomic-widgets/settings/transformers/register',
|
||||
function ( $transformers ) {
|
||||
$attributes_key = Attributes_Prop_Type::get_key();
|
||||
$transformers->register(
|
||||
$attributes_key,
|
||||
new Pro_Attributes_Transformer()
|
||||
);
|
||||
},
|
||||
20
|
||||
);
|
||||
|
||||
add_filter(
|
||||
'elementor/atomic-widgets/controls',
|
||||
fn( $element_controls, $atomic_element ) => $this->inject_attrs_control( $element_controls, $atomic_element ),
|
||||
@@ -35,14 +53,17 @@ class Module extends Module_Base {
|
||||
|
||||
private function inject_attrs_control( $element_controls, $atomic_element ) {
|
||||
$schema = $atomic_element::get_props_schema();
|
||||
if ( ! array_key_exists( 'attributes', $schema ) || ! class_exists( '\\Elementor\\Modules\\AtomicWidgets\\PropTypes\\Attributes_Prop_Type' ) ) {
|
||||
|
||||
if ( ! array_key_exists( 'attributes', $schema ) ) {
|
||||
return $element_controls;
|
||||
}
|
||||
|
||||
foreach ( $element_controls as $item ) {
|
||||
if ( $item instanceof Section && $item->get_id() === 'settings' ) {
|
||||
$control = Repeatable_Control::bind_to( 'attributes' )
|
||||
->set_meta( [ 'topDivider' => true ] )
|
||||
$is_empty_controls = empty( $item->get_items() );
|
||||
|
||||
$control = Repeatable_Attributes_Control::bind_to( 'attributes' )
|
||||
->set_meta( [ 'topDivider' => ! $is_empty_controls ] )
|
||||
->set_repeaterLabel( __( 'Attributes', 'elementor-pro' ) )
|
||||
->set_initialValues(
|
||||
[
|
||||
@@ -67,6 +88,14 @@ class Module extends Module_Base {
|
||||
$control->set_prop_key( 'attributes' );
|
||||
}
|
||||
|
||||
if ( $this->is_license_expired() || ! $this->is_attributes_active() ) {
|
||||
$control
|
||||
->set_addItemTooltipProps( [
|
||||
'disabled' => true,
|
||||
] )
|
||||
->set_child_control_props( (object) [ 'readOnly' => true ] );
|
||||
}
|
||||
|
||||
$item->add_item( $control );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorPro\Modules\Attributes\PropsResolver\Transformers\Settings;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\PropsResolver\Props_Resolver_Context;
|
||||
use Elementor\Modules\AtomicWidgets\PropsResolver\Transformer_Base;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Pro_Attributes_Transformer extends Transformer_Base {
|
||||
public function transform( $value, Props_Resolver_Context $context ) {
|
||||
if ( ! is_array( $value ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$result = implode( ' ', array_map( function ( $item ) {
|
||||
if ( ! $this->is_valid_attribute_item( $item ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$escaped_value = esc_attr( $item['value'] );
|
||||
|
||||
return $item['key'] . '="' . $escaped_value . '"';
|
||||
}, $value ) );
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function is_valid_attribute_item( $item ): bool {
|
||||
return isset( $item['key'], $item['value'] )
|
||||
&& '' !== $item['key']
|
||||
&& '' !== $item['value'];
|
||||
}
|
||||
}
|
||||
@@ -435,20 +435,25 @@ class Call_To_Action extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-cta__content' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -419,6 +419,7 @@ class Countdown extends Base_Widget {
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-countdown-wrapper' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
@@ -649,19 +650,24 @@ class Countdown extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-countdown-expire--message' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class Custom_Code_Promotion_Menu_Item extends Base_Promotion_Template {
|
||||
: $connect_url;
|
||||
}
|
||||
|
||||
public function get_cta_text() {
|
||||
public function get_cta_text(): string {
|
||||
if ( ! API::active_licence_has_feature( Custom_Code_Module::MODULE_NAME ) ) {
|
||||
return esc_html__( 'Upgrade Now', 'elementor-pro' );
|
||||
}
|
||||
@@ -45,11 +45,11 @@ class Custom_Code_Promotion_Menu_Item extends Base_Promotion_Template {
|
||||
: esc_html__( 'Connect & Activate', 'elementor-pro' );
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
public function get_label(): string {
|
||||
return $this->get_page_title();
|
||||
}
|
||||
|
||||
public function get_page_title() {
|
||||
public function get_page_title(): string {
|
||||
return esc_html__( 'Custom Code', 'elementor-pro' );
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class Custom_Code_Promotion_Menu_Item extends Base_Promotion_Template {
|
||||
return 'https://www.youtube-nocookie.com/embed/IOovQd1hJUg?si=JLHk3UAexnvTfU1a';
|
||||
}
|
||||
|
||||
public function get_promotion_description() {
|
||||
public function get_promotion_description(): string {
|
||||
return esc_html__(
|
||||
'Add Custom Code snippets to your website.',
|
||||
'elementor-pro'
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\DisplayConditions;
|
||||
|
||||
use Elementor\Modules\AtomicWidgets\Base\Atomic_Control_Base;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Display_Conditions_Control extends Atomic_Control_Base {
|
||||
private ?bool $disabled = null;
|
||||
|
||||
public function get_type(): string {
|
||||
return 'display-conditions';
|
||||
}
|
||||
|
||||
public function set_disabled( bool $disabled ): self {
|
||||
$this->disabled = $disabled;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_props(): array {
|
||||
$props = [];
|
||||
|
||||
if ( null !== $this->disabled ) {
|
||||
$props['disabled'] = $this->disabled;
|
||||
}
|
||||
|
||||
return $props;
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,11 @@ use Elementor\Controls_Manager;
|
||||
use Elementor\Utils;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\Modules\AtomicWidgets\Transformers\Display_Conditions as Display_Conditions_Transformer;
|
||||
use ElementorPro\Modules\DisplayConditions\Classes\Or_Condition;
|
||||
use ElementorPro\Plugin;
|
||||
use Elementor\Modules\AtomicWidgets\Controls\Section;
|
||||
use ElementorPro\Modules\AtomicWidgets\PropTypes\Display_Conditions\Display_Conditions_Prop_Type;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
@@ -14,6 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
||||
class Module extends Module_Base {
|
||||
|
||||
|
||||
private $hidden_elements_ids = [];
|
||||
|
||||
const LICENSE_FEATURE_NAME = 'display-conditions';
|
||||
@@ -27,6 +31,42 @@ class Module extends Module_Base {
|
||||
}
|
||||
|
||||
$this->maybe_add_actions_and_components();
|
||||
|
||||
add_filter(
|
||||
'elementor/atomic-widgets/controls',
|
||||
fn( $element_controls, $atomic_element ) => $this->inject_display_conditions_control( $element_controls, $atomic_element ),
|
||||
100,
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
private function inject_display_conditions_control( $element_controls, $atomic_element ) {
|
||||
|
||||
$schema = $atomic_element::get_props_schema();
|
||||
|
||||
if ( ! array_key_exists( Display_Conditions_Prop_Type::get_key(), $schema ) ) {
|
||||
return $element_controls;
|
||||
}
|
||||
|
||||
foreach ( $element_controls as $item ) {
|
||||
if ( $item instanceof Section && $item->get_id() === 'settings' ) {
|
||||
$control = Display_Conditions_Control::bind_to( Display_Conditions_Prop_Type::get_key() )
|
||||
->set_label( __( 'Display Conditions', 'elementor-pro' ) )
|
||||
->set_meta( [
|
||||
'topDivider' => true,
|
||||
] );
|
||||
|
||||
if ( API::is_license_expired() ) {
|
||||
$control->set_disabled( true );
|
||||
}
|
||||
|
||||
$item->add_item( $control );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $element_controls;
|
||||
}
|
||||
|
||||
public static function should_show_promo(): bool {
|
||||
@@ -75,6 +115,15 @@ class Module extends Module_Base {
|
||||
true
|
||||
);
|
||||
|
||||
$inline_script = sprintf(
|
||||
'window.ElementorProDisplayConditions = %s;',
|
||||
wp_json_encode( [
|
||||
'isLicenseExpired' => API::is_license_expired(),
|
||||
] )
|
||||
);
|
||||
|
||||
wp_add_inline_script( 'e-display-conditions', $inline_script, 'before' );
|
||||
|
||||
wp_set_script_translations( 'e-display-conditions', 'elementor-pro' );
|
||||
}
|
||||
|
||||
@@ -162,9 +211,13 @@ class Module extends Module_Base {
|
||||
}
|
||||
|
||||
protected function get_saved_conditions( $settings ) {
|
||||
$conditions_json = ! empty( $settings['e_display_conditions'] ) ? $settings['e_display_conditions'] : [];
|
||||
if ( isset( $settings[ Display_Conditions_Prop_Type::get_key() ] ) ) {
|
||||
$settings['e_display_conditions'] = Display_Conditions_Transformer::extract_from_settings( $settings );
|
||||
}
|
||||
|
||||
return ! empty( $conditions_json ) && ! empty( $conditions_json[0] )
|
||||
$conditions_json = ! empty( $settings['e_display_conditions'] ) ? $settings['e_display_conditions'] : '[]';
|
||||
|
||||
return ! empty( $conditions_json )
|
||||
? json_decode( $conditions_json[0], true )
|
||||
: [];
|
||||
}
|
||||
@@ -174,7 +227,7 @@ class Module extends Module_Base {
|
||||
$is_visible = true;
|
||||
$saved_conditions = $this->get_saved_conditions( $settings );
|
||||
|
||||
if ( empty( $settings['e_display_conditions'] ) || Plugin::elementor()->editor->is_edit_mode() || empty( $saved_conditions ) ) {
|
||||
if ( Plugin::elementor()->editor->is_edit_mode() || empty( $saved_conditions ) ) {
|
||||
return $is_visible;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ];
|
||||
}
|
||||
@@ -34,12 +38,10 @@ class Contact_URL extends Tag {
|
||||
'label' => esc_html__( 'Type', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'' => '— ' . esc_html__( 'Select', 'elementor-pro' ) . ' —',
|
||||
'email' => esc_html__( 'Email', 'elementor-pro' ),
|
||||
'tel' => esc_html__( 'Tel', 'elementor-pro' ),
|
||||
'sms' => esc_html__( 'SMS', 'elementor-pro' ),
|
||||
'whatsapp' => esc_html__( 'WhatsApp', 'elementor-pro' ),
|
||||
'skype' => esc_html__( 'Skype', 'elementor-pro' ),
|
||||
'messenger' => esc_html__( 'Messenger', 'elementor-pro' ),
|
||||
'viber' => esc_html__( 'Viber', 'elementor-pro' ),
|
||||
'waze' => esc_html__( 'Waze', 'elementor-pro' ),
|
||||
@@ -136,25 +138,6 @@ class Contact_URL extends Tag {
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'skype_action',
|
||||
[
|
||||
'label' => esc_html__( 'Action', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'call' => esc_html__( 'Call', 'elementor-pro' ),
|
||||
'chat' => esc_html__( 'Chat', 'elementor-pro' ),
|
||||
'userinfo' => esc_html__( 'Show Profile', 'elementor-pro' ),
|
||||
'add' => esc_html__( 'Add to Contacts', 'elementor-pro' ),
|
||||
'voicemail' => esc_html__( 'Send Voice Mail', 'elementor-pro' ),
|
||||
],
|
||||
'default' => 'call',
|
||||
'condition' => [
|
||||
'link_type' => 'skype',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'waze_address',
|
||||
[
|
||||
@@ -290,19 +273,6 @@ class Contact_URL extends Tag {
|
||||
return 'https://api.whatsapp.com/send?phone=' . $settings['tel_number'];
|
||||
}
|
||||
|
||||
private function build_skype_link( $settings ) {
|
||||
if ( empty( $settings['username'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$action = 'call';
|
||||
if ( ! empty( $settings['skype_action'] ) ) {
|
||||
$action = $settings['skype_action'];
|
||||
}
|
||||
$link = 'skype:' . $settings['username'] . '?' . $action;
|
||||
return $link;
|
||||
}
|
||||
|
||||
private function build_waze_link( $settings ) {
|
||||
$link = 'https://waze.com/ul?';
|
||||
|
||||
@@ -318,6 +288,10 @@ class Contact_URL extends Tag {
|
||||
private function date_to_iso( $date, $all_day = false ) {
|
||||
$time = strtotime( $date );
|
||||
|
||||
if ( false === $time ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( $all_day ) {
|
||||
return gmdate( 'Ymd\/Ymd', $time );
|
||||
}
|
||||
@@ -340,7 +314,9 @@ class Contact_URL extends Tag {
|
||||
if ( empty( $settings['event_end_date'] ) ) {
|
||||
$dates = $this->date_to_iso( $settings['event_start_date'], true );
|
||||
} else {
|
||||
$dates = $this->date_to_iso( $settings['event_start_date'] ) . '/' . $this->date_to_iso( $settings['event_end_date'] );
|
||||
$start = $this->date_to_iso( $settings['event_start_date'] );
|
||||
$end = $this->date_to_iso( $settings['event_end_date'] );
|
||||
$dates = $start && $end ? ( $start . '/' . $end ) : ( $start ? $start : ( $end ? $end : '' ) );
|
||||
}
|
||||
}
|
||||
$link = 'https://www.google.com/calendar/render?action=TEMPLATE&';
|
||||
@@ -436,9 +412,6 @@ class Contact_URL extends Tag {
|
||||
case 'whatsapp':
|
||||
$value = $this->build_whatsapp_link( $settings );
|
||||
break;
|
||||
case 'skype':
|
||||
$value = $this->build_skype_link( $settings );
|
||||
break;
|
||||
case 'waze':
|
||||
$value = $this->build_waze_link( $settings );
|
||||
break;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ class Module extends Module_Base {
|
||||
parent::__construct();
|
||||
|
||||
// TODO: Should we move this to the `is_active` method?
|
||||
if ( API::is_licence_has_feature( static::LICENSE_FEATURE_NAME ) ) {
|
||||
if ( ! API::is_licence_has_feature( static::LICENSE_FEATURE_NAME ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -504,20 +504,25 @@ class Flip_Box extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-flip-box__front .elementor-flip-box__layer__overlay' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
@@ -1129,23 +1134,28 @@ class Flip_Box extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-flip-box__back .elementor-flip-box__layer__overlay' => 'text-align: {{VALUE}}',
|
||||
'{{WRAPPER}} .elementor-flip-box__button' => 'margin-{{VALUE}}: 0',
|
||||
'{{WRAPPER}} .elementor-flip-box__button' => 'margin-inline-{{VALUE}}: 0',
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -1587,6 +1597,7 @@ class Flip_Box extends Base_Widget {
|
||||
$title_tag = Utils::validate_html_tag( $settings['title_tag'] );
|
||||
$description_tag = Utils::validate_html_tag( $settings['description_tag'] );
|
||||
$migration_allowed = Icons_Manager::is_migration_allowed();
|
||||
|
||||
$this->add_render_attribute( 'button', 'class', [
|
||||
'elementor-flip-box__button',
|
||||
'elementor-button',
|
||||
@@ -1620,14 +1631,19 @@ class Flip_Box extends Base_Widget {
|
||||
}
|
||||
|
||||
if ( ! empty( $settings['icon'] ) ) {
|
||||
$this->add_render_attribute( 'icon', 'class', $settings['icon'] );
|
||||
$this->add_render_attribute(
|
||||
'icon',
|
||||
[
|
||||
'class' => $settings['icon'],
|
||||
'aria-hidden' => 'true',
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$has_icon = ! empty( $settings['icon'] ) || ! empty( $settings['selected_icon'] );
|
||||
$migrated = isset( $settings['__fa4_migrated']['selected_icon'] );
|
||||
$is_new = empty( $settings['icon'] ) && $migration_allowed;
|
||||
|
||||
?>
|
||||
<div class="elementor-flip-box" tabindex="0">
|
||||
<div class="elementor-flip-box__layer elementor-flip-box__front">
|
||||
@@ -1641,7 +1657,7 @@ class Flip_Box extends Base_Widget {
|
||||
<div <?php $this->print_render_attribute_string( 'icon-wrapper' ); ?>>
|
||||
<div class="elementor-icon">
|
||||
<?php if ( $is_new || $migrated ) :
|
||||
Icons_Manager::render_icon( $settings['selected_icon'] );
|
||||
Icons_Manager::render_icon( $settings['selected_icon'], [ 'aria-hidden' => 'true' ] );
|
||||
else : ?>
|
||||
<i <?php $this->print_render_attribute_string( 'icon' ); ?>></i>
|
||||
<?php endif; ?>
|
||||
@@ -1736,7 +1752,6 @@ class Flip_Box extends Base_Widget {
|
||||
iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ),
|
||||
migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' );
|
||||
#>
|
||||
|
||||
<div class="elementor-flip-box" tabindex="0">
|
||||
<div class="elementor-flip-box__layer elementor-flip-box__front">
|
||||
<div class="elementor-flip-box__layer__overlay">
|
||||
@@ -1751,7 +1766,7 @@ class Flip_Box extends Base_Widget {
|
||||
<# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #>
|
||||
{{{ iconHTML.value }}}
|
||||
<# } else { #>
|
||||
<i class="{{ settings.icon }}"></i>
|
||||
<i class="{{ settings.icon }}" aria-hidden="true"></i>
|
||||
<# } #>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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
wp-content/plugins/elementor-pro/modules/interactions/hooks.php
Normal file
130
wp-content/plugins/elementor-pro/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';
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -35,7 +35,7 @@ class Note_Query_Builder extends Model_Query_Builder {
|
||||
*
|
||||
* @param \wpdb|null $connection
|
||||
*/
|
||||
public function __construct( \wpdb $connection = null ) {
|
||||
public function __construct( ?\wpdb $connection = null ) {
|
||||
parent::__construct( Note::class, $connection );
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ class Note_Query_Builder extends Model_Query_Builder {
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function with_replies( callable $callback = null ) {
|
||||
public function with_replies( ?callable $callback = null ) {
|
||||
$key = 'replies';
|
||||
$foreign_key = 'parent_id';
|
||||
$local_key = 'id';
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ class Module extends App {
|
||||
}
|
||||
|
||||
private function on_elementor_pro_init() {
|
||||
$has_license = API::is_license_active();
|
||||
$has_license = API::is_license_active() && API::is_licence_has_feature( static::LICENSE_FEATURE_NAME );
|
||||
|
||||
if ( ! $has_license ) {
|
||||
return;
|
||||
|
||||
@@ -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 using all of Elementor's widgets. 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 );
|
||||
|
||||
@@ -256,20 +256,25 @@ abstract class Posts_Base extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-pagination' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
|
||||
@@ -993,19 +993,24 @@ class Price_Table extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-price-table__features-list' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -443,19 +443,24 @@ class Slides extends Base_Widget {
|
||||
'label' => esc_html__( 'Text Align', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .swiper-slide-inner' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
@@ -859,20 +864,25 @@ class Slides extends Base_Widget {
|
||||
'label' => esc_html__( 'Text Align', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .swiper-slide-inner' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -545,9 +545,6 @@ class Table_Of_Contents extends Base_Widget {
|
||||
]
|
||||
);
|
||||
|
||||
$logical_start = is_rtl() ? 'right' : 'left';
|
||||
$logical_end = is_rtl() ? 'left' : 'right';
|
||||
|
||||
$this->add_responsive_control(
|
||||
'header_text_align',
|
||||
[
|
||||
@@ -556,7 +553,7 @@ class Table_Of_Contents extends Base_Widget {
|
||||
'options' => [
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => "eicon-text-align-$logical_start",
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
@@ -564,10 +561,11 @@ class Table_Of_Contents extends Base_Widget {
|
||||
],
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => "eicon-text-align-$logical_end",
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'start',
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-toc__header-title' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
@@ -633,15 +631,16 @@ class Table_Of_Contents extends Base_Widget {
|
||||
'options' => [
|
||||
'row-reverse' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => "eicon-h-align-$logical_start",
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'row' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => "eicon-h-align-$logical_end",
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'row',
|
||||
'toggle' => false,
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-toc__header' => 'flex-direction: {{VALUE}};',
|
||||
],
|
||||
|
||||
@@ -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' ] );
|
||||
|
||||
@@ -56,16 +56,16 @@ class Post_Content extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
@@ -73,6 +73,11 @@ class Post_Content extends Base_Widget {
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
|
||||
@@ -79,16 +79,16 @@ class Post_Excerpt extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
@@ -96,6 +96,11 @@ class Post_Excerpt extends Base_Widget {
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
"{{WRAPPER}}{$widget_container_selector}" => 'text-align: {{VALUE}};',
|
||||
],
|
||||
|
||||
@@ -204,19 +204,24 @@ class Search_Form extends Base {
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-search-form' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\Transitions;
|
||||
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\License\API;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'transitions';
|
||||
}
|
||||
|
||||
private function is_transitions_active() {
|
||||
return API::is_licence_has_feature( 'transitions' );
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
if ( $this->is_transitions_active() ) {
|
||||
add_filter(
|
||||
'elementor/atomic-widgets/styles/transitions/allowed-properties',
|
||||
[ $this, 'extend_allowed_properties' ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function extend_allowed_properties( array $core_properties ): array {
|
||||
$pro_properties = [
|
||||
'margin',
|
||||
'margin-block-end',
|
||||
'margin-inline-start',
|
||||
'margin-inline-end',
|
||||
'margin-block-start',
|
||||
'padding',
|
||||
'padding-block-end',
|
||||
'padding-inline-start',
|
||||
'padding-inline-end',
|
||||
'padding-block-start',
|
||||
'flex',
|
||||
'flex-grow',
|
||||
'flex-shrink',
|
||||
'flex-basis',
|
||||
'width',
|
||||
'height',
|
||||
'max-height',
|
||||
'max-width',
|
||||
'min-height',
|
||||
'min-width',
|
||||
'top',
|
||||
'left',
|
||||
'bottom',
|
||||
'right',
|
||||
'z-index',
|
||||
'color',
|
||||
'font-size',
|
||||
'line-height',
|
||||
'letter-spacing',
|
||||
'word-spacing',
|
||||
'font-variation-settings',
|
||||
'-webkit-text-stroke-color',
|
||||
'background-color',
|
||||
'background-position',
|
||||
'box-shadow',
|
||||
'border',
|
||||
'border-radius',
|
||||
'border-color',
|
||||
'border-width',
|
||||
'opacity',
|
||||
'transform',
|
||||
'filter',
|
||||
];
|
||||
|
||||
return array_merge( $core_properties, $pro_properties );
|
||||
}
|
||||
}
|
||||
@@ -81,24 +81,16 @@ class Style_Schema {
|
||||
}
|
||||
|
||||
private function update_union( Union_Prop_Type $union_prop_type ): Union_Prop_Type {
|
||||
$new_union = Union_Prop_Type::make();
|
||||
$dependencies = $union_prop_type->get_dependencies();
|
||||
$new_union->set_dependencies( $dependencies );
|
||||
|
||||
foreach ( $union_prop_type->get_prop_types() as $prop_type ) {
|
||||
$updated = $this->update( $prop_type );
|
||||
|
||||
if ( $updated instanceof Union_Prop_Type ) {
|
||||
foreach ( $updated->get_prop_types() as $updated_prop_type ) {
|
||||
$new_union->add_prop_type( $updated_prop_type );
|
||||
$union_prop_type->add_prop_type( $updated_prop_type );
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$new_union->add_prop_type( $updated );
|
||||
}
|
||||
|
||||
return $new_union;
|
||||
return $union_prop_type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace ElementorPro\Modules\Variables;
|
||||
|
||||
use Elementor\Modules\Variables\PropTypes\Size_Variable_Prop_Type;
|
||||
use ElementorPro\Plugin;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
|
||||
@@ -48,6 +49,8 @@ class Module extends Module_Base {
|
||||
}
|
||||
|
||||
$this->hooks()->register();
|
||||
|
||||
add_action( 'elementor/editor/before_enqueue_scripts', fn () => $this->enqueue_editor_scripts() );
|
||||
}
|
||||
|
||||
private function is_experiment_active(): bool {
|
||||
@@ -56,4 +59,24 @@ class Module extends Module_Base {
|
||||
&& Plugin::elementor()->experiments->is_feature_active( AtomicWidgetsModule::EXPERIMENT_NAME )
|
||||
&& Plugin::elementor()->experiments->is_feature_active( VariablesModule::EXPERIMENT_NAME );
|
||||
}
|
||||
|
||||
private function get_quota_config( $limit ): array {
|
||||
return [
|
||||
Size_Variable_Prop_Type::get_key() => $limit,
|
||||
];
|
||||
}
|
||||
|
||||
public function enqueue_editor_scripts() {
|
||||
$limit = 100000;
|
||||
|
||||
if ( API::is_license_expired() ) {
|
||||
$limit = 0;
|
||||
}
|
||||
|
||||
wp_add_inline_script(
|
||||
'elementor-common',
|
||||
'window.ElementorVariablesQuotaConfigExtended = ' . wp_json_encode( $this->get_quota_config( $limit ) ) . ';',
|
||||
'before'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\Woocommerce\ImportExportCustomization;
|
||||
|
||||
use Elementor\App\Modules\ImportExportCustomization\Runners\Revert\Revert_Runner_Base;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Woocommerce_Settings_Revert extends Revert_Runner_Base {
|
||||
|
||||
public static function get_name(): string {
|
||||
return 'woocommerce-settings';
|
||||
}
|
||||
|
||||
public function should_revert( array $data ): bool {
|
||||
return isset( $data['runners'][ static::get_name() ] );
|
||||
}
|
||||
|
||||
public function revert( array $data ) {
|
||||
$runner_data = $data['runners'][ static::get_name() ];
|
||||
|
||||
$previous_pages = $runner_data['previous_pages'] ?? [];
|
||||
|
||||
foreach ( $previous_pages as $key => $value ) {
|
||||
update_option( $key, $value );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\Woocommerce\ImportExportCustomization;
|
||||
|
||||
use Elementor\App\Modules\ImportExportCustomization\Runners\Import\Import_Runner_Base;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Woocommerce_Settings extends Import_Runner_Base {
|
||||
|
||||
const KEYS_TO_IMPORT = [
|
||||
'woocommerce_cart_page_id',
|
||||
'woocommerce_checkout_page_id',
|
||||
'woocommerce_myaccount_page_id',
|
||||
'woocommerce_terms_page_id',
|
||||
'elementor_woocommerce_purchase_summary_page_id',
|
||||
'woocommerce_shop_page_id',
|
||||
];
|
||||
|
||||
private $old_values = [];
|
||||
private $imported_pages = [];
|
||||
|
||||
public static function get_name(): string {
|
||||
return 'woocommerce-settings';
|
||||
}
|
||||
|
||||
public function should_import( array $data ) {
|
||||
return (
|
||||
isset( $data['include'] ) &&
|
||||
in_array( 'settings', $data['include'], true ) &&
|
||||
! empty( $data['site_settings']['settings'] )
|
||||
);
|
||||
}
|
||||
|
||||
public function import( array $data, array $imported_data ) {
|
||||
$new_site_settings = $data['site_settings']['settings'];
|
||||
|
||||
$pages = $imported_data['content']['page']['succeed'] ?? [];
|
||||
|
||||
$imported = false;
|
||||
|
||||
foreach ( self::KEYS_TO_IMPORT as $key ) {
|
||||
$value = $new_site_settings[ $key ] ?? null;
|
||||
if ( isset( $pages[ $value ] ) ) {
|
||||
$page = $pages[ $value ];
|
||||
|
||||
$this->old_values[ $key ] = get_option( $key );
|
||||
$update_result = update_option( $key, $page );
|
||||
if ( $update_result ) {
|
||||
$this->imported_pages[ $key ] = $page;
|
||||
$imported = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [ static::get_name() => $imported ];
|
||||
}
|
||||
|
||||
public function get_import_session_metadata(): array {
|
||||
return [
|
||||
'previous_pages' => $this->old_values,
|
||||
'imported_pages' => $this->imported_pages,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ use ElementorPro\Modules\Woocommerce\Widgets\Products as Products_Widget;
|
||||
use Elementor\Icons_Manager;
|
||||
use ElementorPro\Modules\LoopBuilder\Module as LoopBuilderModule;
|
||||
use ElementorPro\License\API;
|
||||
use Elementor\App\Modules\ImportExportCustomization\Processes\Import;
|
||||
use Elementor\App\Modules\ImportExportCustomization\Processes\Revert;
|
||||
use ElementorPro\Modules\Woocommerce\ImportExportCustomization\Woocommerce_Settings;
|
||||
use ElementorPro\Modules\Woocommerce\ImportExportCustomization\Woocommerce_Settings_Revert;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
@@ -1360,9 +1364,20 @@ class Module extends Module_Base {
|
||||
return Plugin::elementor()->preview->is_preview_mode() || is_preview();
|
||||
}
|
||||
|
||||
public function register_import_runner( Import $import ) {
|
||||
$import->register( new Woocommerce_Settings() );
|
||||
}
|
||||
|
||||
public function register_revert_runner( Revert $revert ) {
|
||||
$revert->register( new Woocommerce_Settings_Revert() );
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
add_action( 'elementor/import-export-customization/import-kit', [ $this, 'register_import_runner' ] );
|
||||
add_action( 'elementor/import-export-customization/revert-kit', [ $this, 'register_revert_runner' ] );
|
||||
|
||||
add_action( 'elementor/kit/register_tabs', [ $this, 'init_site_settings' ], 1, 40 );
|
||||
$this->add_update_kit_settings_hooks();
|
||||
|
||||
|
||||
@@ -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',
|
||||
[
|
||||
|
||||
@@ -62,16 +62,16 @@ class Archive_Description extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
@@ -79,6 +79,11 @@ class Archive_Description extends Base_Widget {
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -90,19 +90,24 @@ class Breadcrumb extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .woocommerce-breadcrumb' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -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',
|
||||
[
|
||||
|
||||
@@ -72,19 +72,24 @@ class Product_Price extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -169,19 +169,24 @@ class Product_Related extends Products_Base {
|
||||
'label' => esc_html__( 'Text Align', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'.woocommerce {{WRAPPER}}.elementor-wc-products .products > h2' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -56,16 +56,16 @@ class Product_Short_Description extends Base_Widget {
|
||||
'label' => esc_html__( 'Alignment', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
@@ -73,6 +73,11 @@ class Product_Short_Description extends Base_Widget {
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
@@ -156,19 +156,24 @@ class Product_Upsell extends Products_Base {
|
||||
'label' => esc_html__( 'Text Align', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'elementor-pro' ),
|
||||
'start' => [
|
||||
'title' => esc_html__( 'Start', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'elementor-pro' ),
|
||||
'end' => [
|
||||
'title' => esc_html__( 'End', 'elementor-pro' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'classes' => 'elementor-control-start-end',
|
||||
'selectors_dictionary' => [
|
||||
'left' => is_rtl() ? 'end' : 'start',
|
||||
'right' => is_rtl() ? 'start' : 'end',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}.elementor-wc-products .products > h2' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user