Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../public_h.../wp-conte.../plugins/themify-.../includes
File: system.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class Themify_Popup {
[2] Fix | Delete
[3] Fix | Delete
public static function init() {
[4] Fix | Delete
add_action( 'init', array( __CLASS__, 'i18n' ), 5 );
[5] Fix | Delete
add_action( 'init', array( __CLASS__, 'register_post_type' ) );
[6] Fix | Delete
add_action( 'wp_loaded', array( __CLASS__, 'loaded' ) );
[7] Fix | Delete
if ( is_admin() ) {
[8] Fix | Delete
add_filter( 'themify_exclude_cpt_post_options', array( __CLASS__, 'exclude_post_options' ) );
[9] Fix | Delete
add_filter( 'themify_do_metaboxes', array( __CLASS__, 'meta_box' ) );
[10] Fix | Delete
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_enqueue' ) );
[11] Fix | Delete
} else {
[12] Fix | Delete
add_filter( 'wp_nav_menu_objects', array( __CLASS__, 'wp_nav_menu_objects' ) );
[13] Fix | Delete
add_filter( 'template_include', array( __CLASS__, 'template_include' ), 100 );
[14] Fix | Delete
add_action( 'template_redirect', array( __CLASS__, 'hooks' ) );
[15] Fix | Delete
add_shortcode( 'tf_popup', array( __CLASS__, 'shortcode' ) );
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
add_action('themify_builder_active_enqueue',array( __CLASS__, 'themify_builder_layouts' ));
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
public static function hooks() {
[22] Fix | Delete
if( ! is_singular( 'themify_popup' ) ) {
[23] Fix | Delete
add_action( 'wp_footer', array( __CLASS__, 'render' ), 1 );
[24] Fix | Delete
}
[25] Fix | Delete
elseif( ! current_user_can( 'manage_options' ) ) {
[26] Fix | Delete
wp_redirect( home_url() );
[27] Fix | Delete
exit;
[28] Fix | Delete
}
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
public static function loaded(){
[32] Fix | Delete
if(is_user_logged_in()){
[33] Fix | Delete
add_filter('wp_editor_settings',array(__CLASS__,'tinymce_init'));
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public static function tinymce_init($settings){
[38] Fix | Delete
remove_filter('wp_editor_settings',array(__CLASS__,'tinymce_init'));
[39] Fix | Delete
include THEMIFY_POPUP_DIR . 'includes/tinymce.php';
[40] Fix | Delete
return $settings;
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
public static function i18n() {
[44] Fix | Delete
load_plugin_textdomain( 'themify-popup', false, plugin_basename( THEMIFY_POPUP_DIR ) . '/languages' );
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
public static function register_post_type() {
[48] Fix | Delete
register_post_type( 'themify_popup', array(
[49] Fix | Delete
'labels'=> array(
[50] Fix | Delete
'name' => _x( 'Popups', 'post type general name', 'themify-popup' ),
[51] Fix | Delete
'singular_name' => _x( 'Popup', 'post type singular name', 'themify-popup' ),
[52] Fix | Delete
'menu_name' => _x( 'Themify Popups', 'admin menu', 'themify-popup' ),
[53] Fix | Delete
'name_admin_bar' => _x( 'Popup', 'add new on admin bar', 'themify-popup' ),
[54] Fix | Delete
'add_new' => _x( 'Add New', 'book', 'themify-popup' ),
[55] Fix | Delete
'add_new_item' => __( 'Add New Popup', 'themify-popup' ),
[56] Fix | Delete
'new_item' => __( 'New Popup', 'themify-popup' ),
[57] Fix | Delete
'edit_item' => __( 'Edit Popup', 'themify-popup' ),
[58] Fix | Delete
'all_items' => __( 'Manage Popups', 'themify-popup' )
[59] Fix | Delete
),
[60] Fix | Delete
'public' => true,
[61] Fix | Delete
'publicly_queryable' => true,
[62] Fix | Delete
'show_ui' => true,
[63] Fix | Delete
'show_in_menu' => true,
[64] Fix | Delete
'show_in_nav_menus' => true,
[65] Fix | Delete
'query_var' => true,
[66] Fix | Delete
'rewrite' => array( 'slug' => 'themify_popup' ),
[67] Fix | Delete
'capability_type' => 'post',
[68] Fix | Delete
'menu_position' => 80, /* below Settings */
[69] Fix | Delete
'has_archive' => false,
[70] Fix | Delete
'supports' => array( 'title', 'editor' )
[71] Fix | Delete
) );
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
public static function meta_box( $panels ) {
[75] Fix | Delete
$options = include self::get_view_path( 'config.php' );
[76] Fix | Delete
$panels[] = array(
[77] Fix | Delete
'name' => __( 'Popup Settings', 'themify' ),
[78] Fix | Delete
'id' => 'themify-popup',
[79] Fix | Delete
'options' => $options,
[80] Fix | Delete
'pages' => 'themify_popup',
[81] Fix | Delete
'default_active' => true,
[82] Fix | Delete
);
[83] Fix | Delete
$panels[] = array(
[84] Fix | Delete
'name' => __( 'Custom CSS', 'themify-popup' ),
[85] Fix | Delete
'id' => 'themify-popup-css',
[86] Fix | Delete
'options' => array(
[87] Fix | Delete
array(
[88] Fix | Delete
'name' => 'custom_css',
[89] Fix | Delete
'title' => __( 'Custom CSS', 'themify-popup' ),
[90] Fix | Delete
'type' => 'textarea',
[91] Fix | Delete
'size' => 55,
[92] Fix | Delete
'rows' => 25,
[93] Fix | Delete
'description' => __( 'You can use <code>%POPUP%</code> to reference this popup.', 'themify-popup' ),
[94] Fix | Delete
),
[95] Fix | Delete
),
[96] Fix | Delete
'pages' => 'themify_popup'
[97] Fix | Delete
);
[98] Fix | Delete
[99] Fix | Delete
return $panels;
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
[103] Fix | Delete
public static function admin_enqueue() {
[104] Fix | Delete
if( get_current_screen()->post_type === 'themify_popup' ){
[105] Fix | Delete
wp_enqueue_script( 'themify-popup', THEMIFY_POPUP_URI . 'assets/admin.js', array( 'jquery' ), THEMIFY_POPUP_VERSION, true );
[106] Fix | Delete
}
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
protected static function get_popups() {
[110] Fix | Delete
$datenow = date_i18n('Y-m-d H:i:s');
[111] Fix | Delete
$args = array(
[112] Fix | Delete
'post_type' => 'themify_popup',
[113] Fix | Delete
'post_status' => 'publish',
[114] Fix | Delete
'posts_per_page' => -1,
[115] Fix | Delete
'no_found_rows'=>true,
[116] Fix | Delete
'meta_query' => array(
[117] Fix | Delete
'relation' => 'AND',
[118] Fix | Delete
array(
[119] Fix | Delete
'key' => 'popup_start_at',
[120] Fix | Delete
'value' => $datenow,
[121] Fix | Delete
'compare' => '<=',
[122] Fix | Delete
'type' => 'datetime'
[123] Fix | Delete
),
[124] Fix | Delete
array(
[125] Fix | Delete
'key' => 'popup_end_at',
[126] Fix | Delete
'value' => $datenow,
[127] Fix | Delete
'type' => 'datetime',
[128] Fix | Delete
'compare' => '>='
[129] Fix | Delete
)
[130] Fix | Delete
)
[131] Fix | Delete
);
[132] Fix | Delete
if (class_exists('SitePress',false)) {
[133] Fix | Delete
/*
[134] Fix | Delete
* For some unknown reason WPML 4.0.2 will not render posts for other languages if suppress_filters or posts_per_page value is not a string type.
[135] Fix | Delete
*/
[136] Fix | Delete
$args['suppress_filters'] = '0';
[137] Fix | Delete
}
[138] Fix | Delete
$the_query = new WP_Query();
[139] Fix | Delete
return $the_query->query( apply_filters( 'themify_popup_query_args', $args ) );
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
protected static function get_view_path( $name ) {
[143] Fix | Delete
if( locate_template( 'themify-popup/' . $name ) ) {
[144] Fix | Delete
return locate_template( 'themify-popup/' . $name );
[145] Fix | Delete
}
[146] Fix | Delete
elseif( is_file( THEMIFY_POPUP_DIR . 'views/' . $name ) ) {
[147] Fix | Delete
return THEMIFY_POPUP_DIR . 'views/' . $name;
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
return false;
[151] Fix | Delete
}
[152] Fix | Delete
[153] Fix | Delete
protected static function load_view( $name, $data = array() ) {
[154] Fix | Delete
extract( $data );
[155] Fix | Delete
if( $view = self::get_view_path( $name ) ) {
[156] Fix | Delete
ob_start();
[157] Fix | Delete
include( $view );
[158] Fix | Delete
return ob_get_clean();
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
return '';
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
public static function render() {
[165] Fix | Delete
[166] Fix | Delete
/* disable popups on these post types and when Themify Builder editor is on */
[167] Fix | Delete
if (is_singular(array('tbp_template', 'tbuilder_layout_part', 'tglobal_style', ))) {
[168] Fix | Delete
return;
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
$popups = self::get_popups();
[172] Fix | Delete
/* add the page view counter cookie? */
[173] Fix | Delete
$page_view = false;
[174] Fix | Delete
[175] Fix | Delete
foreach ( $popups as $k=>$popup ) {
[176] Fix | Delete
if ( ! self::is_popup_visible( $popup->ID ) ) {
[177] Fix | Delete
unset($popups[$k]);
[178] Fix | Delete
}
[179] Fix | Delete
if( $page_view === false ) {
[180] Fix | Delete
$page_view = get_post_meta( $popup->ID, 'popup_page_view', true ) ? true : false;
[181] Fix | Delete
}
[182] Fix | Delete
}
[183] Fix | Delete
[184] Fix | Delete
self::register_assets( $page_view );
[185] Fix | Delete
[186] Fix | Delete
if ( empty( $popups ) ) {
[187] Fix | Delete
/* there's no popup to display, but load the popup scripts.js file anyway, need it to count page views */
[188] Fix | Delete
if ( $page_view ) {
[189] Fix | Delete
wp_enqueue_script( 'themify-popup' );
[190] Fix | Delete
}
[191] Fix | Delete
return;
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
self::enqueue();
[195] Fix | Delete
[196] Fix | Delete
do_action( 'themify_popup_before_render' );
[197] Fix | Delete
[198] Fix | Delete
echo self::load_view( 'render.php', array(
[199] Fix | Delete
'popups' => $popups
[200] Fix | Delete
) );
[201] Fix | Delete
[202] Fix | Delete
do_action( 'themify_popup_after_render' );
[203] Fix | Delete
}
[204] Fix | Delete
[205] Fix | Delete
protected static function register_assets( $count_views = false ) {
[206] Fix | Delete
wp_register_script( 'themify-popup', THEMIFY_POPUP_URI . 'assets/scripts.js', array( 'jquery' ), THEMIFY_POPUP_VERSION, true );
[207] Fix | Delete
wp_localize_script( 'themify-popup', 'themifyPopup', array(
[208] Fix | Delete
'assets' => THEMIFY_POPUP_URI . 'assets',
[209] Fix | Delete
'count_views' => $count_views
[210] Fix | Delete
) );
[211] Fix | Delete
[212] Fix | Delete
wp_register_style( 'themify-builder-animate', THEMIFY_POPUP_URI . 'assets/animate.min.css',null,'3.6.2' );
[213] Fix | Delete
wp_register_style( 'magnific', THEMIFY_POPUP_URI . 'assets/lightbox.css',null,THEMIFY_POPUP_VERSION );
[214] Fix | Delete
wp_register_style( 'themify-popup', THEMIFY_POPUP_URI . 'assets/styles.css', array( 'themify-builder-animate', 'magnific' ), THEMIFY_POPUP_VERSION );
[215] Fix | Delete
}
[216] Fix | Delete
[217] Fix | Delete
protected static function enqueue() {
[218] Fix | Delete
wp_enqueue_script( 'themify-popup' );
[219] Fix | Delete
wp_enqueue_style( 'themify-popup' );
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
/**
[223] Fix | Delete
* Displays the contents of the popup
[224] Fix | Delete
*
[225] Fix | Delete
* Themify Builder content is manually added, this is to avoid
[226] Fix | Delete
* issues with WooCommerce.
[227] Fix | Delete
*
[228] Fix | Delete
* @return void
[229] Fix | Delete
*/
[230] Fix | Delete
protected static function the_content() {
[231] Fix | Delete
if (class_exists('\Themify_Builder',false) ) {
[232] Fix | Delete
if(isset(Themify_Builder::$is_loop)){
[233] Fix | Delete
$isLoop=Themify_Builder::$is_loop;
[234] Fix | Delete
Themify_Builder::$is_loop=true;
[235] Fix | Delete
}
[236] Fix | Delete
else{//backward
[237] Fix | Delete
global $ThemifyBuilder;
[238] Fix | Delete
$isLoop = $ThemifyBuilder->in_the_loop === true;
[239] Fix | Delete
$ThemifyBuilder->in_the_loop = true;
[240] Fix | Delete
}
[241] Fix | Delete
add_filter( 'themify_builder_display', '__return_false' ); // disable default Builder output
[242] Fix | Delete
[243] Fix | Delete
/* disable Row Width options: rows inside the popup cannot be displayed as fullwidth */
[244] Fix | Delete
add_filter( 'themify_builder_row_classes', array( __CLASS__, 'themify_builder_row_classes' ), 10, 3 );
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
/**
[248] Fix | Delete
* do the_content() but return the result instead */
[249] Fix | Delete
$content = get_the_content();
[250] Fix | Delete
/** This filter is documented in wp-includes/post-template.php */
[251] Fix | Delete
$content = apply_filters( 'the_content', $content );
[252] Fix | Delete
$content = str_replace( ']]>', ']]&gt;', $content );
[253] Fix | Delete
if (class_exists('\Themify_Builder',false) ) {
[254] Fix | Delete
remove_filter( 'themify_builder_display', '__return_false' );
[255] Fix | Delete
remove_filter( 'themify_builder_row_classes', array( __CLASS__, 'themify_builder_row_classes' ), 10, 3 );
[256] Fix | Delete
if(isset(Themify_Builder::$is_loop)){
[257] Fix | Delete
Themify_Builder::$is_loop=$isLoop;
[258] Fix | Delete
$content=Themify_Builder::render(get_the_id(), $content);
[259] Fix | Delete
}
[260] Fix | Delete
else{//backward
[261] Fix | Delete
$ThemifyBuilder->in_the_loop = $isLoop;
[262] Fix | Delete
$content = $ThemifyBuilder->get_builder_output( get_the_id(), $content );
[263] Fix | Delete
}
[264] Fix | Delete
}
[265] Fix | Delete
if(function_exists('themify_make_lazy')){ // lazy load images inside popups
[266] Fix | Delete
$content=themify_make_lazy($content,false);
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
echo $content;
[270] Fix | Delete
}
[271] Fix | Delete
[272] Fix | Delete
public static function themify_builder_row_classes( $row_classes, $row, $builder_id ) {
[273] Fix | Delete
return str_replace( array( 'fullwidth_row_container', 'fullwidth' ), '', $row_classes );
[274] Fix | Delete
}
[275] Fix | Delete
[276] Fix | Delete
protected static function get_element_attributes( $props ) {
[277] Fix | Delete
$out = '';
[278] Fix | Delete
foreach( $props as $atts => $val ) {
[279] Fix | Delete
if( ! in_array( $atts, array( 'id', 'class', 'style' ), true ) && substr( $atts, 0, 5 ) !== 'data-' ) {
[280] Fix | Delete
$atts = 'data-' . $atts;
[281] Fix | Delete
}
[282] Fix | Delete
$out .= ' '. $atts . '="' . esc_attr( $val ) . '"';
[283] Fix | Delete
}
[284] Fix | Delete
return $out;
[285] Fix | Delete
}
[286] Fix | Delete
[287] Fix | Delete
/**
[288] Fix | Delete
* Fix URLs in menu items pointing to an inline popup
[289] Fix | Delete
*/
[290] Fix | Delete
public static function wp_nav_menu_objects( $items ) {
[291] Fix | Delete
foreach( $items as $item ) {
[292] Fix | Delete
if( $item->type === 'post_type' && $item->object === 'themify_popup' ) {
[293] Fix | Delete
$item->url = '#themify-popup-' . $item->object_id;
[294] Fix | Delete
$item->classes[] = 'tf-popup';
[295] Fix | Delete
}
[296] Fix | Delete
}
[297] Fix | Delete
[298] Fix | Delete
return $items;
[299] Fix | Delete
}
[300] Fix | Delete
[301] Fix | Delete
public static function shortcode( $atts, $content = null ) {
[302] Fix | Delete
if( is_singular( 'themify_popup' ) ) {
[303] Fix | Delete
return;
[304] Fix | Delete
}
[305] Fix | Delete
$atts= shortcode_atts( array(
[306] Fix | Delete
'color' => '',
[307] Fix | Delete
'size' => '',
[308] Fix | Delete
'style' => '',
[309] Fix | Delete
'link' => 0,
[310] Fix | Delete
'target'=> '',
[311] Fix | Delete
'text' => ''
[312] Fix | Delete
), $atts, 'tf_popup' );
[313] Fix | Delete
[314] Fix | Delete
// WPML compatibility
[315] Fix | Delete
$atts['link'] = apply_filters( 'wpml_object_id', $atts['link'], 'post', true );
[316] Fix | Delete
if( ! $post = get_post( $atts['link'] ) ) {
[317] Fix | Delete
return;
[318] Fix | Delete
}
[319] Fix | Delete
$cl='';
[320] Fix | Delete
if($atts['style']!==''){
[321] Fix | Delete
$cl=$atts['style'];
[322] Fix | Delete
}
[323] Fix | Delete
if($atts['size']!==''){
[324] Fix | Delete
$cl.=' '.$atts['size'];
[325] Fix | Delete
}
[326] Fix | Delete
if($cl!==''){
[327] Fix | Delete
$cl=esc_attr(trim($cl));
[328] Fix | Delete
$cl=' '.$cl;
[329] Fix | Delete
}
[330] Fix | Delete
$html = '<a href="#themify-popup-' . $atts['link'] . '" class="tf_popup'. $cl . '"';
[331] Fix | Delete
unset($cl);
[332] Fix | Delete
if ( $atts['color']!=='' || $atts['text']!=='' ) {
[333] Fix | Delete
if ( $atts['color']!=='' ) {
[334] Fix | Delete
$atts['color'] = "background-color:{$atts['color']};";
[335] Fix | Delete
}
[336] Fix | Delete
if ( $atts['text']!=='' ) {
[337] Fix | Delete
$atts['text'] = "color:{$atts['text']};";
[338] Fix | Delete
}
[339] Fix | Delete
$html.=' style="'.esc_attr( $atts['color'].$atts['text'] ).'"';
[340] Fix | Delete
}
[341] Fix | Delete
if ( $atts['target']!=='' ) {
[342] Fix | Delete
$html.=' target="'.esc_attr( $atts['target'] ).'"';
[343] Fix | Delete
}
[344] Fix | Delete
unset($atts);
[345] Fix | Delete
$html.= '>' . do_shortcode( $content ) . '</a>';
[346] Fix | Delete
[347] Fix | Delete
return $html;
[348] Fix | Delete
}
[349] Fix | Delete
[350] Fix | Delete
/**
[351] Fix | Delete
* Use custom template file on popup single pages
[352] Fix | Delete
*
[353] Fix | Delete
* @since 1.0
[354] Fix | Delete
*/
[355] Fix | Delete
public static function template_include( $template ) {
[356] Fix | Delete
if( is_singular( 'themify_popup' ) ) {
[357] Fix | Delete
$template = self::get_view_path( 'single-popup.php' );
[358] Fix | Delete
}
[359] Fix | Delete
[360] Fix | Delete
return $template;
[361] Fix | Delete
}
[362] Fix | Delete
[363] Fix | Delete
/**
[364] Fix | Delete
* Checks whether a popup should be displayed or not
[365] Fix | Delete
*
[366] Fix | Delete
* @since 1.0
[367] Fix | Delete
* @return bool
[368] Fix | Delete
*/
[369] Fix | Delete
protected static function is_popup_visible( $id ) {
[370] Fix | Delete
if ( themify_popup_get( 'popup_show_on_toggle', 'all-pages',$id ) === 'specific-pages' && themify_popup_check( 'popup_show',$id ) && ! themify_verify_assignments( themify_popup_get( 'popup_show',null,$id ) ) ) {
[371] Fix | Delete
return false;
[372] Fix | Delete
}
[373] Fix | Delete
$showTo = themify_popup_get( 'popup_show_to',null,$id );
[374] Fix | Delete
if ( ( $showTo === 'guest' && is_user_logged_in() ) || ( $showTo === 'user' && ! is_user_logged_in() ) ) {
[375] Fix | Delete
return false;
[376] Fix | Delete
}
[377] Fix | Delete
[378] Fix | Delete
if ( themify_popup_get( 'popup_trigger', 'timedelay',$id ) === 'manual' ) {
[379] Fix | Delete
return true;
[380] Fix | Delete
}
[381] Fix | Delete
[382] Fix | Delete
// has user seen this popup before?
[383] Fix | Delete
/**
[384] Fix | Delete
* Migration routine: previsouly used "show_once" checkbox is converted to "limit_count" (number).
[385] Fix | Delete
*/
[386] Fix | Delete
if ( themify_popup_check( 'popup_show_once',$id ) ) {
[387] Fix | Delete
delete_post_meta( $id, 'popup_show_once' );
[388] Fix | Delete
add_post_meta( $id, 'popup_limit_count', 1 );
[389] Fix | Delete
}
[390] Fix | Delete
if ( isset( $_COOKIE["themify-popup-{$id}"] ) && themify_popup_check( 'popup_limit_count',$id ) && $_COOKIE["themify-popup-{$id}"] >= themify_popup_get( 'popup_limit_count',null,$id ) ) {
[391] Fix | Delete
return false;
[392] Fix | Delete
}
[393] Fix | Delete
[394] Fix | Delete
// check if popup has a page view limit
[395] Fix | Delete
if ( ($view_count = themify_popup_get( 'popup_page_view', 0,$id )) && ( !isset( $_COOKIE['themify_popup_page_view'] ) || $_COOKIE['themify_popup_page_view'] <$view_count )) {
[396] Fix | Delete
return false;
[397] Fix | Delete
}
[398] Fix | Delete
[399] Fix | Delete
return true;
[400] Fix | Delete
}
[401] Fix | Delete
[402] Fix | Delete
/**
[403] Fix | Delete
* Add sample layouts bundled with Popup plugin to Themify Builder
[404] Fix | Delete
*
[405] Fix | Delete
* @since 1.0.0
[406] Fix | Delete
*/
[407] Fix | Delete
public static function themify_builder_layouts() {
[408] Fix | Delete
$handler='themify-popup-builder-active';
[409] Fix | Delete
$arr=include THEMIFY_POPUP_DIR . 'sample/layouts.php';
[410] Fix | Delete
themify_enque_script($handler, THEMIFY_POPUP_URI . 'assets/builder-active.js',THEMIFY_POPUP_VERSION, array('themify-builder-app-js'), true );
[411] Fix | Delete
wp_localize_script($handler, 'themifyPopupBuilder', array(
[412] Fix | Delete
'data'=>$arr,
[413] Fix | Delete
'title'=>__( 'Themify Popup', 'themify-popup' )
[414] Fix | Delete
));
[415] Fix | Delete
}
[416] Fix | Delete
[417] Fix | Delete
public static function exclude_post_options($types){
[418] Fix | Delete
$types[] = 'themify_popup';
[419] Fix | Delete
return $types;
[420] Fix | Delete
}
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
/**
[424] Fix | Delete
* Check if option is set for the current popup in the loop
[425] Fix | Delete
*
[426] Fix | Delete
* @since 1.0
[427] Fix | Delete
*/
[428] Fix | Delete
function themify_popup_check( $var,$id=null ) {
[429] Fix | Delete
$res=themify_popup_get($var,null,$id);
[430] Fix | Delete
return !empty($res);
[431] Fix | Delete
}
[432] Fix | Delete
[433] Fix | Delete
/**
[434] Fix | Delete
* Get an option for the current popup in the loop
[435] Fix | Delete
*
[436] Fix | Delete
* @since 1.0
[437] Fix | Delete
*/
[438] Fix | Delete
function themify_popup_get( $var, $default = null,$id=null ) {
[439] Fix | Delete
if($id===null){
[440] Fix | Delete
global $post;
[441] Fix | Delete
if(is_object( $post )){
[442] Fix | Delete
$id=$post->ID;
[443] Fix | Delete
}
[444] Fix | Delete
}
[445] Fix | Delete
$postmeta = $id!==null ?get_post_meta( $id, $var, true ):'';
[446] Fix | Delete
return $postmeta !== '' ?$postmeta:$default;
[447] Fix | Delete
}
[448] Fix | Delete
[449] Fix | Delete
/**
[450] Fix | Delete
* Return the custom CSS codes for current popup (in the loop)
[451] Fix | Delete
*
[452] Fix | Delete
* @return string
[453] Fix | Delete
*/
[454] Fix | Delete
function themify_popup_get_custom_css() {
[455] Fix | Delete
return str_replace( '%POPUP%', '#themify-popup-' . get_the_id(), themify_popup_get( 'custom_css', '' ) );
[456] Fix | Delete
}
[457] Fix | Delete
[458] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function