PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.6.4
Post Grid Gutenberg Blocks – PostX v2.6.4
5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 2.1.2 All 237 releases
ultimate-post / addons / elementor / init.php

init.php in Post Grid Gutenberg Blocks – PostX 2.6.4, at addons/elementor/init.php

46 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || exit;
3
4 add_filter('ultp_addons_config', 'ultp_elementor_config');
5 function ultp_elementor_config( $config ) {
6 $configuration = array(
7 'name' => __( 'Elementor Addons', 'ultimate-post' ),
8 'desc' => __( 'Use Gutenberg blocks inside Elementor via Save Template addons.', 'ultimate-post' ),
9 'img' => ULTP_URL.'/assets/img/addons/elementor-icon.svg',
10 'is_pro' => false,
11 'live' => 'https://www.wpxpo.com/postx/addons/elementor/',
12 'docs' => 'https://docs.wpxpo.com/docs/postx/add-on/elementor-addon/',
13 );
14 $arr['ultp_elementor'] = $configuration;
15 return $arr + $config;
16 }
17
18 add_action('plugins_loaded', 'ultp_elementor_init');
19 function ultp_elementor_init(){
20 $settings = ultimate_post()->get_setting('ultp_elementor');
21 if ($settings == 'true') {
22 if(did_action( 'elementor/loaded' )){
23 require_once ULTP_PATH.'/addons/elementor/Elementor.php';
24 Elementor_ULTP_Extension::instance();
25 }
26 }
27 }
28
29 // Elementor Backend Compatiblity
30 add_action( 'elementor/editor/after_register_scripts', 'postx_elementor_widget_scripts' );
31 add_action( 'elementor/editor/after_enqueue_styles', 'postx_elementor_widget_styles' );
32
33 function postx_elementor_widget_styles() {
34 wp_register_style('ultp-style-editor', ULTP_URL.'assets/css/style.min.css', array(), ultimate_post()->get_setting('save_version') );
35 wp_enqueue_style('ultp-style-editor');
36 }
37
38 function postx_elementor_widget_scripts() {
39 wp_register_script('ultp-script-editor', ULTP_URL.'assets/js/ultp.min.js', array('jquery'), ultimate_post()->get_setting('save_version'), true);
40 wp_enqueue_script('ultp-script-editor');
41 wp_localize_script('ultp-script-editor', 'ultp_data_frontend', array(
42 'url' => ULTP_URL,
43 'ajax' => admin_url('admin-ajax.php'),
44 'security' => wp_create_nonce('ultp-nonce')
45 ));
46 }