Offer', CP_PLUGIN_URL . 'modules/modal/assets/demos/special_offer/special_offer.html', 'http://downloads.brainstormforce.com/convertplug/presets/screenshot_yellow_food_pet.png', CP_PLUGIN_URL . 'modules/modal/assets/demos/special_offer/customizer.js', 'All,modal popup,Updates,Offers', 'Shortcode,Canvas,HTML,Custom,Pet,Food', 'Yello_pet_food_offer', ), ); if ( '' !== $preset ) { $temp_arr = $modal_temp_array[ $preset ]; $modal_temp_array = array(); $modal_temp_array[ $preset ] = $temp_arr; $args = array_merge( $args, $modal_temp_array ); } else { $args = array_merge( $args, $modal_temp_array ); } } return $args; }?> } } else { $pos = strpos( $val[0], $property ); $full = ( $strict ) ? ( 0 === $pos && strlen( $val[0] ) === strlen( $property ) ) : true; if ( false !== $pos && $full ) { $new_styles[] = $val; } } } return ! empty( $new_styles ); } /** * Plugin name for VC. * * @since 4.2 * @return string */ function vc_plugin_name() { return vc_manager()->pluginName(); } /** * @since 4.4.3 used in vc_base when getting an custom css output * * @param $filename * * @param bool $partial * * @return bool|mixed|string */ function vc_file_get_contents( $filename, $partial = false ) { global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once( ABSPATH . '/wp-admin/includes/file.php' ); WP_Filesystem( false, false, true ); } /** @var $wp_filesystem WP_Filesystem_Base */ if ( ! is_object( $wp_filesystem ) || ! $output = $wp_filesystem->get_contents( $filename ) ) { /*if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) { } elseif ( ! $wp_filesystem->connect() ) { } elseif ( ! $wp_filesystem->is_writable( $filename ) ) { } else { }*/ $output = file_get_contents( $filename ); } return $output; } /** * HowTo: vc_role_access()->who('administrator')->with('editor')->can('frontend_editor'); * @since 4.8 * @return Vc_Role_Access; */ function vc_role_access() { return vc_manager()->getRoleAccess(); } /** * Get access manager for current user. * HowTo: vc_user_access()->->with('editor')->can('frontend_editor'); * @since 4.8 * @return Vc_Current_User_Access; */ function vc_user_access() { return vc_manager()->getCurrentUserAccess(); } function vc_user_roles_get_all() { require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-roles.php' ); $vc_roles = new Vc_Roles(); $capabilities = array(); foreach ( $vc_roles->getParts() as $part ) { $partObj = vc_user_access()->part( $part ); $capabilities[ $part ] = array( 'state' => $partObj->getState(), 'state_key' => $partObj->getStateKey(), 'capabilities' => $partObj->getAllCaps(), ); } return $capabilities; } /** * Return a $_GET action param for ajax * @since 4.8 * @return bool */ function vc_wp_action() { return isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : false; } /** * @param $data * * @return string */ function vc_generate_nonce( $data ) { return wp_create_nonce( is_array( $data ) ? ( 'vc-nonce-' . implode( '|', $data ) ) : ( 'vc-nonce-' . $data ) ); } /** * @param $nonce * @param $data * * @return bool */ function vc_verify_nonce( $nonce, $data ) { return (bool) wp_verify_nonce( $nonce, ( is_array( $data ) ? ( 'vc-nonce-' . implode( '|', $data ) ) : ( 'vc-nonce-' . $data ) ) ); } /** * @param $nonce * * @return bool */ function vc_verify_admin_nonce( $nonce = '' ) { return (bool) vc_verify_nonce( ! empty( $nonce ) ? $nonce : vc_request_param( '_vcnonce' ), 'vc-admin-nonce' ); } /** * @param $nonce * * @return bool */ function vc_verify_public_nonce( $nonce = '' ) { return (bool) vc_verify_nonce( ( ! empty( $nonce ) ? $nonce : vc_request_param( '_vcnonce' ) ), 'vc-public-nonce' ); } function vc_check_post_type( $type ) { if ( empty( $type ) ) { $type = get_post_type(); } $valid = apply_filters( 'vc_check_post_type_validation', null, $type ); if ( is_null( $valid ) ) { if ( is_multisite() && is_super_admin() ) { return true; } $state = vc_user_access()->part( 'post_types' )->getState(); if ( null === $state ) { return in_array( $type, vc_default_editor_post_types() ); } else if ( true === $state && ! in_array( $type, vc_default_editor_post_types() ) ) { $valid = false; } else { $valid = vc_user_access()->part( 'post_types' )->can( $type )->get(); } } return $valid; } function vc_user_access_check_shortcode_edit( $shortcode ) { $do_check = apply_filters( 'vc_user_access_check-shortcode_edit', null, $shortcode ); if ( is_null( $do_check ) ) { $state_check = vc_user_access()->part( 'shortcodes' )->checkStateAny( true, 'edit', null )->get(); if ( $state_check ) { return true; } else { return vc_user_access()->part( 'shortcodes' )->canAny( $shortcode . '_all', $shortcode . '_edit' )->get(); } } else { return $do_check; } } function vc_user_access_check_shortcode_all( $shortcode ) { $do_check = apply_filters( 'vc_user_access_check-shortcode_all', null, $shortcode ); if ( is_null( $do_check ) ) { return vc_user_access()->part( 'shortcodes' )->checkStateAny( true, 'custom', null )->can( $shortcode . '_all' )->get(); } else { return $do_check; } } /** * htmlspecialchars_decode_deep * Call the htmlspecialchars_decode to a gived multilevel array * * @since 4.8 * * @param mixed $value The value to be stripped. * * @return mixed Stripped value. */ function vc_htmlspecialchars_decode_deep( $value ) { if ( is_array( $value ) ) { $value = array_map( 'vc_htmlspecialchars_decode_deep', $value ); } elseif ( is_object( $value ) ) { $vars = get_object_vars( $value ); foreach ( $vars as $key => $data ) { $value->{$key} = vc_htmlspecialchars_decode_deep( $data ); } } elseif ( is_string( $value ) ) { $value = htmlspecialchars_decode( $value ); } return $value; } function vc_str_remove_protocol( $str ) { return str_replace( array( 'https://', 'http://', ), '//', $str ); }?>