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.../httpdocs/clone/wp-conte.../plugins/themify-.../includes
File: tinymce.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class Themify_Popup_TinyMCE {
[2] Fix | Delete
[3] Fix | Delete
static function init() {
[4] Fix | Delete
add_filter( 'mce_external_plugins', array( __CLASS__, 'mce_external_plugins' ) );
[5] Fix | Delete
add_filter( 'mce_buttons', array( __CLASS__, 'mce_buttons' ) );
[6] Fix | Delete
}
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Add plugin JS file to list of external plugins.
[10] Fix | Delete
*
[11] Fix | Delete
* @param array $mce_external_plugins
[12] Fix | Delete
* @return mixed
[13] Fix | Delete
*/
[14] Fix | Delete
static function mce_external_plugins( $mce_external_plugins ) {
[15] Fix | Delete
$mce_external_plugins['mceThemifyPopup'] = THEMIFY_POPUP_URI . 'assets/tinymce.js';
[16] Fix | Delete
self::tinymce_localize();
[17] Fix | Delete
return $mce_external_plugins;
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
static function mce_buttons( $mce_buttons ) {
[21] Fix | Delete
$mce_buttons[] = 'separator';
[22] Fix | Delete
$mce_buttons[] = 'mceThemifyPopup';
[23] Fix | Delete
return $mce_buttons;
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
private static function get_manual_popup_list() {
[27] Fix | Delete
$list = array();
[28] Fix | Delete
$args = array(
[29] Fix | Delete
'post_type' => 'themify_popup',
[30] Fix | Delete
'post_status' => 'publish',
[31] Fix | Delete
'posts_per_page' => -1,
[32] Fix | Delete
'no_found_rows'=>true,
[33] Fix | Delete
'nopaging' => true,
[34] Fix | Delete
'meta_query' => array(
[35] Fix | Delete
array(
[36] Fix | Delete
'key' => 'popup_trigger',
[37] Fix | Delete
'value' => 'manual',
[38] Fix | Delete
'compare' => '=',
[39] Fix | Delete
),
[40] Fix | Delete
)
[41] Fix | Delete
);
[42] Fix | Delete
if (class_exists('SitePress',false)) {
[43] Fix | Delete
/*
[44] Fix | Delete
* This will insure that only wpml current language related popups are shown in shortcode popup list.
[45] Fix | Delete
*/
[46] Fix | Delete
$args['suppress_filters'] = '0';
[47] Fix | Delete
}
[48] Fix | Delete
$query = get_posts( $args );
[49] Fix | Delete
if( ! empty( $query ) ) {
[50] Fix | Delete
foreach( $query as $popup ) {
[51] Fix | Delete
$list[] = array( 'text' => $popup->post_title, 'value' => $popup->ID );
[52] Fix | Delete
}
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
return $list;
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
private static function tinymce_localize() {
[59] Fix | Delete
$fields = array(
[60] Fix | Delete
'label' => __( 'Button', 'themify-popup' ),
[61] Fix | Delete
'fields' => array(
[62] Fix | Delete
array(
[63] Fix | Delete
'name' => 'link',
[64] Fix | Delete
'type' => 'listbox',
[65] Fix | Delete
'values' => self::get_manual_popup_list(),
[66] Fix | Delete
'label' => __( 'Link Button To', 'themify-popup' ),
[67] Fix | Delete
),
[68] Fix | Delete
array(
[69] Fix | Delete
'name' => 'link_description',
[70] Fix | Delete
'type' => 'container',
[71] Fix | Delete
'html' => sprintf( __( 'Add new popups at <a href="#">Themify Popups > Add new</a>.<br> The popup must select "Manual launch" in order to be launched manually.', 'themify-popup' ), admin_url( 'post-new.php?post_type=themify_popup' ) ) . '<hr style="border-bottom: 1px solid #ccc; margin: 5px 0;">',
[72] Fix | Delete
),
[73] Fix | Delete
array(
[74] Fix | Delete
'name' => 'label',
[75] Fix | Delete
'type' => 'textbox',
[76] Fix | Delete
'label' => __( 'Button Text', 'themify-popup' ),
[77] Fix | Delete
'value' => __( 'Launch Popup', 'themify-popup' ),
[78] Fix | Delete
),
[79] Fix | Delete
array(
[80] Fix | Delete
'name' => 'color',
[81] Fix | Delete
'type' => 'listbox',
[82] Fix | Delete
'values' => array(
[83] Fix | Delete
array( 'value' => '', 'text' => '' ),
[84] Fix | Delete
array( 'value' => 'blue', 'text' => __( 'Blue', 'themify-popup' ) ),
[85] Fix | Delete
array( 'value' => 'green', 'text' => __( 'Green', 'themify-popup' ) ),
[86] Fix | Delete
array( 'value' => 'red', 'text' => __( 'Red', 'themify-popup' ) ),
[87] Fix | Delete
array( 'value' => 'purple', 'text' => __( 'Purple', 'themify-popup' ) ),
[88] Fix | Delete
array( 'value' => 'yellow', 'text' => __( 'Yellow', 'themify-popup' ) ),
[89] Fix | Delete
array( 'value' => 'orange', 'text' => __( 'Orange', 'themify-popup' ) ),
[90] Fix | Delete
array( 'value' => 'pink', 'text' => __( 'Pink', 'themify-popup' ) ),
[91] Fix | Delete
array( 'value' => 'lavender', 'text' => __( 'Lavender', 'themify-popup' ) ),
[92] Fix | Delete
array( 'value' => 'gray', 'text' => __( 'Gray', 'themify-popup' ) ),
[93] Fix | Delete
array( 'value' => 'black', 'text' => __( 'Black', 'themify-popup' ) ),
[94] Fix | Delete
array( 'value' => 'light-yellow', 'text' => __( 'Light Yellow', 'themify-popup' ) ),
[95] Fix | Delete
array( 'value' => 'light-blue', 'text' => __( 'Light Blue', 'themify-popup' ) ),
[96] Fix | Delete
array( 'value' => 'light-green', 'text' => __( 'Light Green', 'themify-popup' ) ),
[97] Fix | Delete
),
[98] Fix | Delete
'label' => __( 'Button Color', 'themify-popup' ),
[99] Fix | Delete
),
[100] Fix | Delete
array(
[101] Fix | Delete
'name' => 'size',
[102] Fix | Delete
'type' => 'listbox',
[103] Fix | Delete
'values' => array(
[104] Fix | Delete
array( 'value' => '', 'text' => __( 'Normal', 'themify-popup' ) ),
[105] Fix | Delete
array( 'value' => 'small', 'text' => __( 'Small', 'themify-popup' ) ),
[106] Fix | Delete
array( 'value' => 'large', 'text' => __( 'Large', 'themify-popup' ) ),
[107] Fix | Delete
array( 'value' => 'xlarge', 'text' => __( 'xLarge', 'themify-popup' ) ),
[108] Fix | Delete
),
[109] Fix | Delete
'label' => __( 'Button Size', 'themify-popup' ),
[110] Fix | Delete
),
[111] Fix | Delete
array(
[112] Fix | Delete
'name' => 'custom_color',
[113] Fix | Delete
'type' => 'colorbox',
[114] Fix | Delete
'value' => '',
[115] Fix | Delete
'label' => __( 'Custom Background Color', 'themify-popup' ),
[116] Fix | Delete
'tooltip' => __( 'Enter color in hexadecimal format. For example, #ddd.', 'themify-popup' )
[117] Fix | Delete
),
[118] Fix | Delete
array(
[119] Fix | Delete
'name' => 'custom_text_color',
[120] Fix | Delete
'type' => 'colorbox',
[121] Fix | Delete
'label' => __( 'Custom Button Text Color', 'themify-popup' ),
[122] Fix | Delete
'tooltip' => __( 'Enter color in hexadecimal format. For example, #000.', 'themify-popup' )
[123] Fix | Delete
),
[124] Fix | Delete
array(
[125] Fix | Delete
'name' => 'block',
[126] Fix | Delete
'type' => 'checkbox',
[127] Fix | Delete
'label' => __( 'Fullwidth Button', 'themify-popup' ),
[128] Fix | Delete
),
[129] Fix | Delete
array(
[130] Fix | Delete
'name' => 'style',
[131] Fix | Delete
'type' => 'textbox',
[132] Fix | Delete
'label' => __( 'Additional Styles', 'themify-popup' ),
[133] Fix | Delete
'tooltip' => __( 'Additional button styles. You can enter one or more of: outline, gradient, flat, rounded, embossed; or a custom CSS classname.', 'themify-popup' )
[134] Fix | Delete
),
[135] Fix | Delete
),
[136] Fix | Delete
'template' => '[tf_popup<# if ( data.style = [ data.size, data.color, data.style, ( data.block ) ? "block" : "" ].filter( Boolean ).join( " " ) ) { #> style="{{data.style}}"<# } #> link="{{data.link}}"<# if ( data.custom_color ) { #> color="{{data.custom_color}}"<# } #><# if ( data.custom_text_color ) { #> text="{{data.custom_text_color}}"<# } #>]{{{data.label}}}[/tf_popup]',
[137] Fix | Delete
);
[138] Fix | Delete
[139] Fix | Delete
wp_localize_script( 'editor', 'mceThemifyPopup', array(
[140] Fix | Delete
'fields' => $fields,
[141] Fix | Delete
'labels' => array(
[142] Fix | Delete
'menuName' => __( 'Themify Popup', 'themify-popup' )
[143] Fix | Delete
)
[144] Fix | Delete
));
[145] Fix | Delete
}
[146] Fix | Delete
}
[147] Fix | Delete
Themify_Popup_TinyMCE::init();
[148] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function