This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Method for enable / disable addons | |
*/ | |
public function addon_enable_disable() { | |
$current_user_id = get_current_user_id(); | |
if ( !wp_verify_nonce( $_POST['nonce'], 'cf_reset_ajax_nonce' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Method for enable / disable addons | |
*/ | |
public function addon_enable_disable(){ | |
$addonsConfig = maybe_unserialize(get_option('wpcf_addons_config')); | |
$isEnable = (bool) sanitize_text_field( wpcf_function()->avalue_dot('isEnable', $_POST) ); | |
$addonFieldName = sanitize_text_field( wpcf_function()->avalue_dot('addonFieldName', $_POST) ); | |
$addonsConfig[$addonFieldName]['is_enable'] = ($isEnable) ? 1 : 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function upload_file() { | |
if ( ! current_user_can( 'upload_file' ) ) { | |
wp_send_json_error( array( 'errorMessage' => esc_html__( 'You are not allowed to upload files.', 'download-monitor' ) ) ); | |
} | |
$uploadedfile = $_FILES['file']; | |
$image_url = $uploadedfile['tmp_name']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function upload_file() { | |
$uploadedfile = $_FILES['file']; | |
$image_url = $uploadedfile['tmp_name']; | |
$upload_dir = wp_upload_dir(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function alm_is_valid_path( $path ) { | |
if ( ! $path ) { | |
return false; | |
} | |
return false !== strpos( $path, './' ) || false !== strpos( $path, '.\\' ) ? false : true; | |
} | |
function alm_get_layout() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function alm_get_layout() { | |
$form_data = filter_input_array( INPUT_GET ); | |
if ( ! current_user_can( 'edit_theme_options' ) || ! isset( $form_data['nonce'] ) ) { | |
// Bail early if missing WP capabilities or nonce. | |
wp_die( esc_attr__( 'You don\'t belong here.', 'ajax-load-more' ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function get_content_editor() { | |
if (current_user_can('edit_posts')) { | |
$content_key = $this->request['key']; | |
$content_type = $this->request['type']; | |
$builder_post_title = 'dynamic-content-' . $content_type . '-' . $content_key; | |
$builder_post_id = Utils::get_page_by_title( $builder_post_title, 'elementskit_content' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function render_settings_page() { | |
if ( isset( $_POST['save_settings'] ) ) { | |
self::save_settings( $_POST ); | |
} | |
wp_enqueue_style( 'cew-settings', CEW_URL . 'assets/css/settings.css', array(), CEW_VERSION ); | |
wp_enqueue_script( 'cew-settings', CEW_URL . 'assets/js/scripts.js', array( 'jquery', 'jquery-ui' ), CEW_VERSION, true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function render_settings_page() { | |
if ( isset( $_POST['save_settings'] ) ) { | |
self::save_settings( $_POST ); | |
} | |
if ( ! isset( $_POST['cew_settings_nonce'] ) || ! wp_verify_nonce( $_POST['cew_settings_nonce'], CEW_BASENAME . '-settings' ) ) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function render_settings_page() { | |
if ( isset( $_POST['save_settings'] ) ) { | |
self::save_settings( $_POST ); | |
} | |
wp_enqueue_style( 'cew-settings', CEW_URL . 'assets/css/settings.css', array(), CEW_VERSION ); | |
wp_enqueue_script( 'cew-settings', CEW_URL . 'assets/js/scripts.js', array( 'jquery', 'jquery-ui' ), CEW_VERSION, true ); |