| @@ -528,8 +528,9 @@ | ||
| 528 | 528 | 'initial_document' => $document->get_config(), |
| 529 | 529 | 'version' => ELEMENTOR_VERSION, |
| 530 | 530 | 'home_url' => home_url(), |
| 531 | 531 | 'admin_settings_url' => admin_url( 'admin.php?page=' . Settings::PAGE_ID ), |
| 532 | + 'admin_tools_url' => admin_url( 'admin.php?page=' . Tools::PAGE_ID ), | |
| 532 | 533 | 'autosave_interval' => AUTOSAVE_INTERVAL, |
| 533 | 534 | 'tabs' => $plugin->controls_manager->get_tabs(), |
| 534 | 535 | 'controls' => $plugin->controls_manager->get_controls_data(), |
| 535 | 536 | 'elements' => $plugin->elements_manager->get_element_types_config(), |
| @@ -806,32 +807,8 @@ | ||
| 806 | 807 | do_action( 'elementor/editor/wp_head' ); |
| 807 | 808 | } |
| 808 | 809 | |
| 809 | 810 | /** |
| 810 | - * Add editor template. | |
| 811 | - * | |
| 812 | - * Registers new editor templates. | |
| 813 | - * | |
| 814 | - * @since 1.0.0 | |
| 815 | - * @deprecated 2.3.0 Use `Plugin::$instance->common->add_template()` | |
| 816 | - * @access public | |
| 817 | - * | |
| 818 | - * @param string $template Can be either a link to template file or template | |
| 819 | - * HTML content. | |
| 820 | - * @param string $type Optional. Whether to handle the template as path | |
| 821 | - * or text. Default is `path`. | |
| 822 | - */ | |
| 823 | - public function add_editor_template( $template, $type = 'path' ) { | |
| 824 | - _deprecated_function( __METHOD__, '2.3.0', 'Plugin::$instance->common->add_template()' ); | |
| 825 | - | |
| 826 | - $common = Plugin::$instance->common; | |
| 827 | - | |
| 828 | - if ( $common ) { | |
| 829 | - Plugin::$instance->common->add_template( $template, $type ); | |
| 830 | - } | |
| 831 | - } | |
| 832 | - | |
| 833 | - /** | |
| 834 | 811 | * WP footer. |
| 835 | 812 | * |
| 836 | 813 | * Prints Elementor editor with all the editor templates, and render controls, |
| 837 | 814 | * widgets and content elements. |
| @@ -931,98 +908,8 @@ | ||
| 931 | 908 | } |
| 932 | 909 | } |
| 933 | 910 | |
| 934 | 911 | return $results; |
| 935 | - } | |
| 936 | - | |
| 937 | - /** | |
| 938 | - * Create nonce. | |
| 939 | - * | |
| 940 | - * If the user has edit capabilities, it creates a cryptographic token to | |
| 941 | - * give him access to Elementor editor. | |
| 942 | - * | |
| 943 | - * @since 1.8.1 | |
| 944 | - * @since 1.8.7 The `$post_type` parameter was introduces. | |
| 945 | - * @deprecated 2.3.0 Use `Plugin::$instance->common->get_component( 'ajax' )->create_nonce()` instead | |
| 946 | - * @access public | |
| 947 | - * | |
| 948 | - * @param string $post_type The post type to check capabilities. | |
| 949 | - * | |
| 950 | - * @return null|string The nonce token, or `null` if the user has no edit | |
| 951 | - * capabilities. | |
| 952 | - */ | |
| 953 | - public function create_nonce( $post_type ) { | |
| 954 | - _deprecated_function( __METHOD__, '2.3.0', 'Plugin::$instance->common->get_component( \'ajax\' )->create_nonce()' ); | |
| 955 | - | |
| 956 | - /** @var Ajax $ajax */ | |
| 957 | - $ajax = Plugin::$instance->common->get_component( 'ajax' ); | |
| 958 | - | |
| 959 | - return $ajax->create_nonce(); | |
| 960 | - } | |
| 961 | - | |
| 962 | - /** | |
| 963 | - * Verify nonce. | |
| 964 | - * | |
| 965 | - * The user is given an amount of time to use the token, so therefore, since | |
| 966 | - * the user ID and `$action` remain the same, the independent variable is | |
| 967 | - * the time. | |
| 968 | - * | |
| 969 | - * @since 1.8.1 | |
| 970 | - * @deprecated 2.3.0 | |
| 971 | - * @access public | |
| 972 | - * | |
| 973 | - * @param string $nonce Nonce to verify. | |
| 974 | - * | |
| 975 | - * @return false|int If the nonce is invalid it returns `false`. If the | |
| 976 | - * nonce is valid and generated between 0-12 hours ago it | |
| 977 | - * returns `1`. If the nonce is valid and generated | |
| 978 | - * between 12-24 hours ago it returns `2`. | |
| 979 | - */ | |
| 980 | - public function verify_nonce( $nonce ) { | |
| 981 | - _deprecated_function( __METHOD__, '2.3.0', 'wp_verify_nonce()' ); | |
| 982 | - | |
| 983 | - return wp_verify_nonce( $nonce ); | |
| 984 | - } | |
| 985 | - | |
| 986 | - /** | |
| 987 | - * Verify request nonce. | |
| 988 | - * | |
| 989 | - * Whether the request nonce verified or not. | |
| 990 | - * | |
| 991 | - * @since 1.8.1 | |
| 992 | - * @deprecated 2.3.0 Use `Plugin::$instance->common->get_component( 'ajax' )->verify_request_nonce()` instead | |
| 993 | - * @access public | |
| 994 | - * | |
| 995 | - * @return bool True if request nonce verified, False otherwise. | |
| 996 | - */ | |
| 997 | - public function verify_request_nonce() { | |
| 998 | - _deprecated_function( __METHOD__, '2.3.0', 'Plugin::$instance->common->get_component( \'ajax\' )->verify_request_nonce()' ); | |
| 999 | - | |
| 1000 | - /** @var Ajax $ajax */ | |
| 1001 | - $ajax = Plugin::$instance->common->get_component( 'ajax' ); | |
| 1002 | - | |
| 1003 | - return $ajax->verify_request_nonce(); | |
| 1004 | - } | |
| 1005 | - | |
| 1006 | - /** | |
| 1007 | - * Verify ajax nonce. | |
| 1008 | - * | |
| 1009 | - * Verify request nonce and send a JSON request, if not verified returns an | |
| 1010 | - * error. | |
| 1011 | - * | |
| 1012 | - * @since 1.9.0 | |
| 1013 | - * @deprecated 2.3.0 | |
| 1014 | - * @access public | |
| 1015 | - */ | |
| 1016 | - public function verify_ajax_nonce() { | |
| 1017 | - _deprecated_function( __METHOD__, '2.3.0' ); | |
| 1018 | - | |
| 1019 | - /** @var Ajax $ajax */ | |
| 1020 | - $ajax = Plugin::$instance->common->get_component( 'ajax' ); | |
| 1021 | - | |
| 1022 | - if ( ! $ajax->verify_request_nonce() ) { | |
| 1023 | - wp_send_json_error( new \WP_Error( 'token_expired', 'Nonce token expired.' ) ); | |
| 1024 | - } | |
| 1025 | 912 | } |
| 1026 | 913 | |
| 1027 | 914 | /** |
| 1028 | 915 | * Init editor templates. |