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/wp-conte.../plugins/custom-t.../inc
File: admin-hooks.php
<?php
[0] Fix | Delete
add_filter( 'ctf_admin_search_label', 'ctf_return_string_hashtag' );
[1] Fix | Delete
function ctf_return_string_hashtag( $val ) {
[2] Fix | Delete
return 'Hashtag:';
[3] Fix | Delete
}
[4] Fix | Delete
[5] Fix | Delete
add_filter( 'ctf_admin_search_whatis', 'ctf_return_string_instructions' );
[6] Fix | Delete
function ctf_return_string_instructions( $val ) {
[7] Fix | Delete
return 'Select this option and enter any single hashtag for a hashtag feed. Only tweets made within the last 7 days are available initially. Once a tweet has been retrieved the plugin will keep it in a persistent cache indefinitely';
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
add_filter( 'ctf_admin_validate_search_text', 'ctf_validate_search_text', 10, 1 );
[11] Fix | Delete
function ctf_validate_search_text( $val ) {
[12] Fix | Delete
preg_match( "/^[\p{L}0-9_]+|^#+[\p{L}0-9_]+/u", trim( $val ), $hashtags );
[13] Fix | Delete
[14] Fix | Delete
$hashtags = preg_replace( "/#{2,}/", '', $hashtags );
[15] Fix | Delete
[16] Fix | Delete
$new_val = ! empty( $hashtags ) ? $new_val = $hashtags[0] : '';
[17] Fix | Delete
[18] Fix | Delete
if ( substr( $new_val, 0, 1 ) != '#' && $new_val != '' ) {
[19] Fix | Delete
$new_val = '#' . $new_val;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
return $new_val;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
add_filter( 'ctf_admin_validate_usertimeline_text', 'ctf_validate_usertimeline_text', 10, 1 );
[26] Fix | Delete
function ctf_validate_usertimeline_text( $val ) {
[27] Fix | Delete
preg_match( "/^[\p{L}0-9_]{1,16}/u" , str_replace( '@', '', trim( $val ) ), $screenname );
[28] Fix | Delete
[29] Fix | Delete
$new_val = isset( $screenname[0] ) ? $screenname[0] : '';
[30] Fix | Delete
[31] Fix | Delete
return $new_val;
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
add_filter( 'ctf_admin_validate_include_replies', 'ctf_validate_include_replies', 10, 1 );
[35] Fix | Delete
function ctf_validate_include_replies( $val, $type ) {
[36] Fix | Delete
return false;
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
add_filter( 'ctf_admin_set_include_replies', 'ctf_set_include_replies', 10, 1 );
[40] Fix | Delete
function ctf_set_include_replies( $new_input ) {
[41] Fix | Delete
return false;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
add_filter( 'ctf_admin_set_include_retweets', 'ctf_set_include_retweets', 10, 1 );
[45] Fix | Delete
function ctf_set_include_retweets( $new_input ) {
[46] Fix | Delete
#if ( version_compare( CTF_VERSION, '2.0', '>=' ) ) {
[47] Fix | Delete
if ( isset( $new_input ) ) {
[48] Fix | Delete
if ( isset( $new_input['includeretweets'] ) && ($new_input['includeretweets'] == 'on' || $new_input['includeretweets'] == 'true' )) {
[49] Fix | Delete
return true;
[50] Fix | Delete
} else {
[51] Fix | Delete
return false;
[52] Fix | Delete
}
[53] Fix | Delete
}
[54] Fix | Delete
#}else{
[55] Fix | Delete
# if ( isset( $new_input ) && isset( $new_input['type'] ) ) {
[56] Fix | Delete
# if ( isset( $new_input[$new_input['type'] . '_includeretweets'] ) && $new_input[$new_input['type'] . '_includeretweets'] == 'on' ) {
[57] Fix | Delete
# return true;
[58] Fix | Delete
# } else {
[59] Fix | Delete
# return false;
[60] Fix | Delete
# }
[61] Fix | Delete
# }
[62] Fix | Delete
#}
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
add_filter( 'ctf_admin_feed_type_list', 'ctf_return_feed_types' );
[66] Fix | Delete
function ctf_return_feed_types( $val ) {
[67] Fix | Delete
return array( 'hometimelineinclude_replies', 'usertimelineinclude_replies' );
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
add_action( 'ctf_admin_upgrade_note', 'ctf_update_note' );
[71] Fix | Delete
function ctf_update_note() {
[72] Fix | Delete
?>
[73] Fix | Delete
<span class="ctf_note"> - <a href="https://smashballoon.com/custom-twitter-feeds/?utm_campaign=twitter-free&utm_source=settings&utm_medium=proonly" target="_blank">Available in Pro version</a></span>
[74] Fix | Delete
<?php
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
add_action( 'ctf_admin_feed_settings_radio_extra', 'ctf_usertimeline_error_message' );
[78] Fix | Delete
function ctf_usertimeline_error_message( $args )
[79] Fix | Delete
{ //sbi_notice sbi_user_id_error
[80] Fix | Delete
if ( $args['name'] == 'usertimeline') : ?>
[81] Fix | Delete
<div class="ctf_error_notice ctf_usertimeline_error">
[82] Fix | Delete
<?php _e( "<p>Please use a single screenname or Twitter handle of numbers and letters. If you would like to use more than one screen name for your feed, please upgrade to our <a href='https://smashballoon.com/custom-twitter-feeds/?utm_campaign=twitter-free&utm_source=settings&utm_medium=multiuser' target='_blank'>Pro version</a>.</p>" ); ?>
[83] Fix | Delete
</div>
[84] Fix | Delete
<?php endif;
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
add_action( 'ctf_admin_feed_settings_search_extra', 'ctf_hashtag_error_message' );
[88] Fix | Delete
function ctf_hashtag_error_message() {
[89] Fix | Delete
?>
[90] Fix | Delete
<div class="ctf_error_notice ctf_search_error">
[91] Fix | Delete
<?php _e( "<p>Please use a single hashtag of numbers and letters. If you would like to use more than one hashtag or use search terms for your feed, please upgrade to our <a href='https://smashballoon.com/custom-twitter-feeds/?utm_campaign=twitter-free&utm_source=settings&utm_medium=multisearch' target='_blank'>Pro version</a>.</p>" ); ?>
[92] Fix | Delete
</div>
[93] Fix | Delete
<?php
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
add_filter( 'ctf_admin_customize_quick_links', 'ctf_return_customize_quick_links' );
[97] Fix | Delete
function ctf_return_customize_quick_links() {
[98] Fix | Delete
return array(
[99] Fix | Delete
0 => array( 'general', 'General' ),
[100] Fix | Delete
1 => array( 'showhide', 'Show/Hide' ),
[101] Fix | Delete
2 => array( 'misc', 'Misc' ),
[102] Fix | Delete
3 => array( 'advanced', 'Advanced' )
[103] Fix | Delete
);
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
add_filter( 'ctf_admin_style_quick_links', 'ctf_return_style_quick_links' );
[107] Fix | Delete
function ctf_return_style_quick_links() {
[108] Fix | Delete
return array(
[109] Fix | Delete
0 => array( 'general', 'General' ),
[110] Fix | Delete
1 => array( 'header', 'Header' ),
[111] Fix | Delete
2 => array( 'date', 'Date' ),
[112] Fix | Delete
3 => array( 'author', 'Author' ),
[113] Fix | Delete
4 => array( 'text', 'Tweet Text' ),
[114] Fix | Delete
5 => array( 'links', 'Links' ),
[115] Fix | Delete
6 => array( 'quoted', 'Retweet Boxes' ),
[116] Fix | Delete
7 => array( 'actions', 'Tweet Actions' ),
[117] Fix | Delete
8 => array( 'load', 'Load More' )
[118] Fix | Delete
);
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
/*
[122] Fix | Delete
* Pro Options ----------------------------------------
[123] Fix | Delete
*/
[124] Fix | Delete
[125] Fix | Delete
add_action( 'ctf_admin_endpoints', 'ctf_add_mentionstimeline_options', 10, 1 );
[126] Fix | Delete
function ctf_add_mentionstimeline_options( $admin ) {
[127] Fix | Delete
$admin->create_settings_field( array(
[128] Fix | Delete
'name' => 'search_pro',
[129] Fix | Delete
'title' => '<label></label>', // label for the input field
[130] Fix | Delete
'callback' => 'feed_settings_radio', // name of the function that outputs the html
[131] Fix | Delete
'page' => 'ctf_options_feed_settings', // matches the section name
[132] Fix | Delete
'section' => 'ctf_options_feed_settings', // matches the section name
[133] Fix | Delete
'option' => 'ctf_options', // matches the options name
[134] Fix | Delete
'class' => 'ctf-radio ctf_pro', // class for the wrapper and input field
[135] Fix | Delete
'whatis' => 'You can create search feeds which contain a large variety of different terms and operators, such as a combination of #hashtags, @mentions, words, or "phrases"', // what is this? text
[136] Fix | Delete
'label' => "Search",
[137] Fix | Delete
'has_input' => false,
[138] Fix | Delete
'has_replies' => false
[139] Fix | Delete
));
[140] Fix | Delete
$admin->create_settings_field( array(
[141] Fix | Delete
'name' => 'mentionstimeline',
[142] Fix | Delete
'title' => '<label></label>', // label for the input field
[143] Fix | Delete
'callback' => 'feed_settings_radio', // name of the function that outputs the html
[144] Fix | Delete
'page' => 'ctf_options_feed_settings', // matches the section name
[145] Fix | Delete
'section' => 'ctf_options_feed_settings', // matches the section name
[146] Fix | Delete
'option' => 'ctf_options', // matches the options name
[147] Fix | Delete
'class' => 'ctf-radio ctf_pro', // class for the wrapper and input field
[148] Fix | Delete
'whatis' => 'Select this option to display tweets that @mention your twitter handle', // what is this? text
[149] Fix | Delete
'label' => "Mentions",
[150] Fix | Delete
'has_input' => false,
[151] Fix | Delete
'has_replies' => false
[152] Fix | Delete
));
[153] Fix | Delete
$admin->create_settings_field( array(
[154] Fix | Delete
'name' => 'lists',
[155] Fix | Delete
'title' => '<label></label>', // label for the input field
[156] Fix | Delete
'callback' => 'feed_settings_radio', // name of the function that outputs the html
[157] Fix | Delete
'page' => 'ctf_options_feed_settings', // matches the section name
[158] Fix | Delete
'section' => 'ctf_options_feed_settings', // matches the section name
[159] Fix | Delete
'option' => 'ctf_options', // matches the options name
[160] Fix | Delete
'class' => 'ctf-radio ctf_pro', // class for the wrapper and input field
[161] Fix | Delete
'whatis' => 'Enter the list ID of the list(s) you want to display. Use this FAQ to create a list on Twitter. Use the helper to find IDs', // what is this? text
[162] Fix | Delete
'label' => "Lists",
[163] Fix | Delete
'has_input' => false,
[164] Fix | Delete
'has_replies' => false
[165] Fix | Delete
));
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
add_filter( 'ctf_admin_show_hide_list', 'ctf_show_hide_list', 10, 1 );
[169] Fix | Delete
function ctf_show_hide_list( $show_hide_list ) {
[170] Fix | Delete
$show_hide_list[] = array( 'include_replied_to', 'In reply to text' );
[171] Fix | Delete
$show_hide_list[] = array( 'include_media', 'Media (images, videos, gifs)' );
[172] Fix | Delete
$show_hide_list[] = array( 'include_twittercards', 'Twitter Cards' );
[173] Fix | Delete
return $show_hide_list;
[174] Fix | Delete
}
[175] Fix | Delete
[176] Fix | Delete
function ctf_pro_autoscroll_section() {
[177] Fix | Delete
?>
[178] Fix | Delete
<p class="ctf_pro_section_note"><a href="https://smashballoon.com/custom-twitter-feeds/?utm_campaign=twitter-free&utm_source=settings&utm_medium=autoscroll" target="_blank">Upgrade to Pro to enable Autoscroll loading</a></p>
[179] Fix | Delete
<span><a href="javascript:void(0);" class="button button-secondary ctf-show-pro"><b>+</b> Show Pro Options</a></span>
[180] Fix | Delete
[181] Fix | Delete
<div class="ctf-pro-options">
[182] Fix | Delete
<table class="form-table"><tbody><tr><th scope="row"><label for="ctf_autoscroll" title="Click for shortcode option">Set Load More on Scroll as Default</label><code class="ctf_shortcode">autoscroll
[183] Fix | Delete
Eg: autoscroll=true</code></th><td> <input name="ctf_options[autoscroll]" id="ctf_autoscroll" type="checkbox" disabled>
[184] Fix | Delete
<a class="ctf-tooltip-link" href="JavaScript:void(0);"><i class="fa fa-question-circle" aria-hidden="true"></i></a>
[185] Fix | Delete
<p class="ctf-tooltip ctf-more-info">This will make every Twitter feed load more Tweets as the user gets to the bottom of the feed.</p>
[186] Fix | Delete
</td></tr><tr class="default-text"><th scope="row"><label for="ctf_autoscrolldistance">Auto Scroll Trigger Distance</label><code class="ctf_shortcode">autoscrolldistance
[187] Fix | Delete
Eg: autoscrolldistance=2</code></th><td> <input name="ctf_options[autoscrolldistance]" id="ctf_autoscrolldistance" class="default-text" type="text" value="200" disabled>
[188] Fix | Delete
<a class="ctf-tooltip-link" href="JavaScript:void(0);"><i class="fa fa-question-circle" aria-hidden="true"></i></a>
[189] Fix | Delete
<p class="ctf-tooltip ctf-more-info">This is the distance in pixels from the bottom of the page the user must scroll to to trigger the loading of more tweets.</p>
[190] Fix | Delete
</td></tr></tbody></table>
[191] Fix | Delete
</div>
[192] Fix | Delete
<div style="height: 18px;"></div>
[193] Fix | Delete
<?php
[194] Fix | Delete
}
[195] Fix | Delete
[196] Fix | Delete
function ctf_pro_moderation_section() {
[197] Fix | Delete
?>
[198] Fix | Delete
<p class="ctf_pro_section_note"><a href="https://smashballoon.com/custom-twitter-feeds/?utm_campaign=twitter-free&utm_source=settings&utm_medium=moderation" target="_blank">Upgrade to Pro to enable Tweet moderation</a></p>
[199] Fix | Delete
<span><a href="javascript:void(0);" class="button button-secondary ctf-show-pro"><b>+</b> Show Pro Options</a></span>
[200] Fix | Delete
[201] Fix | Delete
<div class="ctf-pro-options">
[202] Fix | Delete
<table class="form-table"><tbody><tr class="large-text"><th scope="row"><label for="ctf_includewords" title="Click for shortcode option">Show Tweets containing these words or hashtags</label><code class="ctf_shortcode">includewords
[203] Fix | Delete
Eg: includewords="#puppy,#cute"</code></th><td> <input name="ctf_options[includewords]" id="ctf_includewords" class="large-text" type="text" value="" disabled>
[204] Fix | Delete
<span>"includewords" separate words by comma</span>
[205] Fix | Delete
</td></tr><tr class="large-text"><th scope="row"><label for="ctf_excludewords">Remove Tweets containing these words or hashtags</label><code class="ctf_shortcode">excludewords
[206] Fix | Delete
Eg: excludewords="#ugly,#bad"</code></th><td> <input name="ctf_options[excludewords]" id="ctf_excludewords" class="large-text" type="text" value="" disabled>
[207] Fix | Delete
<span>"excludewords" separate words by comma</span>
[208] Fix | Delete
</td></tr><tr><th scope="row"></th><td> <p>Show Tweets that contain
[209] Fix | Delete
<select name="ctf_options[includeanyall]" id="ctf_includeanyall" disabled>
[210] Fix | Delete
<option value="any" selected="selected">any</option>
[211] Fix | Delete
<option value="all">all</option>
[212] Fix | Delete
</select>
[213] Fix | Delete
of the "includewords"
[214] Fix | Delete
<select name="ctf_options[filterandor]" id="ctf_filterandor" disabled>
[215] Fix | Delete
<option value="and" selected="selected">and</option>
[216] Fix | Delete
<option value="or">or</option>
[217] Fix | Delete
</select>
[218] Fix | Delete
do not contain
[219] Fix | Delete
<select name="ctf_options[excludeanyall]" id="ctf_excludeanyall" disabled>
[220] Fix | Delete
<option value="any" selected="selected">any</option>
[221] Fix | Delete
<option value="all">all</option>
[222] Fix | Delete
</select>
[223] Fix | Delete
of the "excludewords"
[224] Fix | Delete
</p>
[225] Fix | Delete
</td></tr><tr><th scope="row"><label for="ctf_remove_by_id">Hide Specific Tweets</label></th><td> <textarea name="ctf_options[remove_by_id]" id="ctf_remove_by_id" style="width: 70%;" rows="3" disabled></textarea>
[226] Fix | Delete
<p>separate IDs by comma <a class="ctf-tooltip-link" href="JavaScript:void(0);"><i class="fa fa-question-circle" aria-hidden="true"></i></a>
[227] Fix | Delete
<span class="ctf-tooltip ctf-more-info">These are the specific ID numbers associated with a tweet. You can find the ID of a Tweet by viewing the Tweet on Twitter and copy/pasting the ID number from the end of the URL.</span>
[228] Fix | Delete
</p> </td></tr></tbody></table>
[229] Fix | Delete
</div>
[230] Fix | Delete
<div style="height: 18px;"></div>
[231] Fix | Delete
<?php
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
add_action( 'ctf_admin_style_option', 'ctf_add_masonry_autoscroll_options', 5, 1 );
[235] Fix | Delete
function ctf_add_masonry_autoscroll_options( $admin ) {
[236] Fix | Delete
// custom in reply to text
[237] Fix | Delete
$admin->create_settings_field( array(
[238] Fix | Delete
'name' => 'inreplytotext',
[239] Fix | Delete
'title' => '<label for="ctf_inreplytotext">Translation for "In reply to"</label><code class="ctf_shortcode">inreplytotext
[240] Fix | Delete
Eg: inreplytotext="Als Antwort an"</code>', // label for the input field
[241] Fix | Delete
'callback' => 'default_text', // name of the function that outputs the html
[242] Fix | Delete
'page' => 'ctf_options_text', // matches the section name
[243] Fix | Delete
'section' => 'ctf_options_text', // matches the section name
[244] Fix | Delete
'option' => 'ctf_options', // matches the options name
[245] Fix | Delete
'class' => 'default-text ctf_pro', // class for the wrapper and input field
[246] Fix | Delete
'whatis' => 'This will replace the default text displayed for "In reply to"',
[247] Fix | Delete
'default' => 'In reply to'// "what is this?" text
[248] Fix | Delete
) );
[249] Fix | Delete
[250] Fix | Delete
add_settings_section(
[251] Fix | Delete
'ctf_options_autoscroll', // matches the section name
[252] Fix | Delete
'<span class="ctf_pro_header">Autoscroll Loading</span>',
[253] Fix | Delete
'ctf_pro_autoscroll_section', // callback function to explain the section
[254] Fix | Delete
'ctf_options_autoscroll' // matches the section name
[255] Fix | Delete
);
[256] Fix | Delete
[257] Fix | Delete
add_settings_section(
[258] Fix | Delete
'ctf_options_filter', // matches the section name
[259] Fix | Delete
'<span class="ctf_pro_header">Moderation</span>',
[260] Fix | Delete
'ctf_pro_moderation_section', // callback function to explain the section
[261] Fix | Delete
'ctf_options_filter' // matches the section name
[262] Fix | Delete
);
[263] Fix | Delete
}
[264] Fix | Delete
[265] Fix | Delete
add_action( 'ctf_admin_customize_option', 'ctf_add_customize_general_options', 20, 1 );
[266] Fix | Delete
function ctf_add_customize_general_options( $admin ) {
[267] Fix | Delete
[268] Fix | Delete
// Disable the lightbox
[269] Fix | Delete
$admin->create_settings_field( array(
[270] Fix | Delete
'name' => 'disablelightbox',
[271] Fix | Delete
'title' => '<label for="ctf_disablelightbox">Disable the lightbox</label><code class="ctf_shortcode">disablelightbox
[272] Fix | Delete
Eg: disablelightbox=true</code>', // label for the input field
[273] Fix | Delete
'callback' => 'default_checkbox', // name of the function that outputs the html
[274] Fix | Delete
'page' => 'ctf_options_general', // matches the section name
[275] Fix | Delete
'section' => 'ctf_options_general', // matches the section name
[276] Fix | Delete
'option' => 'ctf_options', // matches the options name
[277] Fix | Delete
'class' => 'default-text ctf_pro', // class for the wrapper and input field
[278] Fix | Delete
'whatis' => 'Disable the popup lightbox for media in the feed'
[279] Fix | Delete
) );
[280] Fix | Delete
}
[281] Fix | Delete
[282] Fix | Delete
[283] Fix | Delete
add_action( 'ctf_admin_customize_option', 'ctf_add_filter_options', 10, 1 );
[284] Fix | Delete
function ctf_add_filter_options( $admin ) {
[285] Fix | Delete
[286] Fix | Delete
add_settings_field(
[287] Fix | Delete
'clear_tc_cache_button',
[288] Fix | Delete
'<label for="ctf_clear_tc_cache_button">Clear Twitter Card Cache</label>',
[289] Fix | Delete
'ctf_clear_tc_cache_button',
[290] Fix | Delete
'ctf_options_advanced',
[291] Fix | Delete
'ctf_options_advanced',
[292] Fix | Delete
array( 'class' => 'ctf_pro')
[293] Fix | Delete
);
[294] Fix | Delete
}
[295] Fix | Delete
[296] Fix | Delete
function ctf_remove_by_id( $args ) {
[297] Fix | Delete
$options = get_option( $args['option'] );
[298] Fix | Delete
$option_string = ( isset( $options[ $args['name'] ] ) ) ? esc_attr( $options[ $args['name'] ] ) : '';
[299] Fix | Delete
?>
[300] Fix | Delete
<textarea name="<?php echo $args['option'].'['.$args['name'].']'; ?>" id="ctf_<?php echo $args['name']; ?>" style="width: 70%;" rows="3"><?php esc_attr_e( stripslashes( $option_string ) ); ?></textarea>
[301] Fix | Delete
<?php if ( isset( $args['extra'] ) ) : ?><p><?php _e( $args['extra'], 'custom-twitter-feeds' ); ?>
[302] Fix | Delete
<a class="ctf-tooltip-link" href="JavaScript:void(0);"><span class="fa fa-question-circle" aria-hidden="true"></span></a>
[303] Fix | Delete
<span class="ctf-tooltip ctf-more-info"><?php _e( $args['whatis'], 'custom-twitter-feeds' ); ?>.</span>
[304] Fix | Delete
</p> <?php endif; ?>
[305] Fix | Delete
<?php
[306] Fix | Delete
}
[307] Fix | Delete
[308] Fix | Delete
function ctf_clear_tc_cache_button() {
[309] Fix | Delete
?>
[310] Fix | Delete
<input id="ctf-clear-tc-cache" class="button-secondary" style="margin-top: 1px;" type="submit" value="<?php esc_attr_e( 'Clear Twitter Cards' ); ?>" />
[311] Fix | Delete
<a class="ctf-tooltip-link" href="JavaScript:void(0);"><span class="fa fa-question-circle" aria-hidden="true"></span></a>
[312] Fix | Delete
<p class="ctf-tooltip ctf-more-info"><?php _e( 'Clicking this button will clear all cached data for your links that have Twitter Cards', 'custom-twitter-feeds' ); ?>.</p>
[313] Fix | Delete
<?php
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
function ctf_filter_operator( $args ) {
[317] Fix | Delete
$options = get_option( $args['option'] );
[318] Fix | Delete
$include_any_all = ( isset( $options['includeanyall'] ) ) ? esc_attr( $options['includeanyall'] ) : 'any';
[319] Fix | Delete
$filter_and_or = ( isset( $options['filterandor'] ) ) ? esc_attr( $options['filterandor'] ) : 'and';
[320] Fix | Delete
$exclude_any_all = ( isset( $options['excludeanyall'] ) ) ? esc_attr( $options['excludeanyall'] ) : 'any';
[321] Fix | Delete
[322] Fix | Delete
?>
[323] Fix | Delete
<p>Show Tweets that contain
[324] Fix | Delete
<select name="<?php echo $args['option'].'[includeanyall]'; ?>" id="ctf_includeanyall">
[325] Fix | Delete
<option value="any" <?php if ( $include_any_all == "any" ) echo 'selected="selected"'; ?> ><?php _e('any'); ?></option>
[326] Fix | Delete
<option value="all" <?php if ( $include_any_all == "all" ) echo 'selected="selected"'; ?> ><?php _e('all'); ?></option>
[327] Fix | Delete
</select>
[328] Fix | Delete
of the "includewords"
[329] Fix | Delete
<select name="<?php echo $args['option'].'[filterandor]'; ?>" id="ctf_filterandor">
[330] Fix | Delete
<option value="and" <?php if ( $filter_and_or == "and" ) echo 'selected="selected"'; ?> ><?php _e('and'); ?></option>
[331] Fix | Delete
<option value="or" <?php if ( $filter_and_or == "or" ) echo 'selected="selected"'; ?> ><?php _e('or'); ?></option>
[332] Fix | Delete
</select>
[333] Fix | Delete
do not contain
[334] Fix | Delete
<select name="<?php echo $args['option'].'[excludeanyall]'; ?>" id="ctf_excludeanyall">
[335] Fix | Delete
<option value="any" <?php if ( $exclude_any_all == "any" ) echo 'selected="selected"'; ?> ><?php _e('any'); ?></option>
[336] Fix | Delete
<option value="all" <?php if ( $exclude_any_all == "all" ) echo 'selected="selected"'; ?> ><?php _e('all'); ?></option>
[337] Fix | Delete
</select>
[338] Fix | Delete
of the "excludewords"
[339] Fix | Delete
</p>
[340] Fix | Delete
<?php if ( isset( $args['whatis'] ) ) : ?>
[341] Fix | Delete
<a class="ctf-tooltip-link" href="JavaScript:void(0);"><span class="fa fa-question-circle" aria-hidden="true"></span></a>
[342] Fix | Delete
<p class="ctf-tooltip ctf-more-info"><?php _e( $args['whatis'], 'custom-twitter-feeds' ); ?>.</p>
[343] Fix | Delete
<?php endif; ?>
[344] Fix | Delete
<?php
[345] Fix | Delete
}
[346] Fix | Delete
[347] Fix | Delete
add_action( 'ctf_admin_add_settings_sections_to_customize', 'ctf_add_masonry_autoload_section_to_customize' );
[348] Fix | Delete
function ctf_add_masonry_autoload_section_to_customize() {
[349] Fix | Delete
?>
[350] Fix | Delete
<a id="autoscroll"></a>
[351] Fix | Delete
<?php do_settings_sections( 'ctf_options_autoscroll' ); ?>
[352] Fix | Delete
<!-- <p class="submit"><input class="button-primary" type="submit" name="save" value="<?php esc_attr_e( 'Save Changes' ); ?>" /></p> -->
[353] Fix | Delete
<hr>
[354] Fix | Delete
<?php
[355] Fix | Delete
}
[356] Fix | Delete
[357] Fix | Delete
add_action( 'ctf_admin_add_settings_sections_to_customize', 'ctf_add_filter_section_to_customize' );
[358] Fix | Delete
function ctf_add_filter_section_to_customize() {
[359] Fix | Delete
echo '<a id="moderation"></a>';
[360] Fix | Delete
do_settings_sections( 'ctf_options_filter' ); // matches the section name
[361] Fix | Delete
echo '<hr>';
[362] Fix | Delete
}
[363] Fix | Delete
[364] Fix | Delete
function ctf_lite_dismiss() {
[365] Fix | Delete
$cap = ctf_get_manage_options_cap();
[366] Fix | Delete
[367] Fix | Delete
if ( ! current_user_can( $cap ) ) {
[368] Fix | Delete
wp_send_json_error(); // This auto-dies.
[369] Fix | Delete
}
[370] Fix | Delete
[371] Fix | Delete
$nonce = isset( $_POST['ctf_nonce'] ) ? sanitize_text_field( $_POST['ctf_nonce'] ) : '';
[372] Fix | Delete
[373] Fix | Delete
if ( ! wp_verify_nonce( $nonce, 'ctf-smash-balloon' ) ) {
[374] Fix | Delete
die ( 'You did not do this the right way!' );
[375] Fix | Delete
}
[376] Fix | Delete
[377] Fix | Delete
set_transient( 'twitter_feed_dismiss_lite', 'dismiss', 1 * WEEK_IN_SECONDS );
[378] Fix | Delete
[379] Fix | Delete
die();
[380] Fix | Delete
}
[381] Fix | Delete
add_action( 'wp_ajax_ctf_lite_dismiss', 'ctf_lite_dismiss' );
[382] Fix | Delete
[383] Fix | Delete
function ctf_admin_hide_unrelated_notices() {
[384] Fix | Delete
[385] Fix | Delete
// Bail if we're not on a ctf screen or page.
[386] Fix | Delete
if ( ! isset( $_GET['page'] )
[387] Fix | Delete
|| ($_GET['page'] !== 'custom-twitter-feeds' && $_GET['page'] !== 'ctf-sw') ) {
[388] Fix | Delete
return;
[389] Fix | Delete
}
[390] Fix | Delete
[391] Fix | Delete
// Extra banned classes and callbacks from third-party plugins.
[392] Fix | Delete
$blacklist = array(
[393] Fix | Delete
'classes' => array(),
[394] Fix | Delete
'callbacks' => array(
[395] Fix | Delete
'ctfdb_admin_notice', // 'Database for ctf' plugin.
[396] Fix | Delete
),
[397] Fix | Delete
);
[398] Fix | Delete
[399] Fix | Delete
global $wp_filter;
[400] Fix | Delete
[401] Fix | Delete
foreach ( array( 'user_admin_notices', 'admin_notices', 'all_admin_notices' ) as $notices_type ) {
[402] Fix | Delete
if ( empty( $wp_filter[ $notices_type ]->callbacks ) || ! is_array( $wp_filter[ $notices_type ]->callbacks ) ) {
[403] Fix | Delete
continue;
[404] Fix | Delete
}
[405] Fix | Delete
foreach ( $wp_filter[ $notices_type ]->callbacks as $priority => $hooks ) {
[406] Fix | Delete
foreach ( $hooks as $name => $arr ) {
[407] Fix | Delete
if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
[408] Fix | Delete
unset( $wp_filter[ $notices_type ]->callbacks[ $priority ][ $name ] );
[409] Fix | Delete
continue;
[410] Fix | Delete
}
[411] Fix | Delete
$class = ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) ? strtolower( get_class( $arr['function'][0] ) ) : '';
[412] Fix | Delete
if (
[413] Fix | Delete
! empty( $class ) &&
[414] Fix | Delete
strpos( $class, 'ctf' ) !== false &&
[415] Fix | Delete
! in_array( $class, $blacklist['classes'], true )
[416] Fix | Delete
) {
[417] Fix | Delete
continue;
[418] Fix | Delete
}
[419] Fix | Delete
if (
[420] Fix | Delete
! empty( $name ) && (
[421] Fix | Delete
strpos( $name, 'ctf' ) === false ||
[422] Fix | Delete
in_array( $class, $blacklist['classes'], true ) ||
[423] Fix | Delete
in_array( $name, $blacklist['callbacks'], true )
[424] Fix | Delete
)
[425] Fix | Delete
) {
[426] Fix | Delete
unset( $wp_filter[ $notices_type ]->callbacks[ $priority ][ $name ] );
[427] Fix | Delete
}
[428] Fix | Delete
}
[429] Fix | Delete
}
[430] Fix | Delete
}
[431] Fix | Delete
}
[432] Fix | Delete
add_action( 'admin_print_scripts', 'ctf_admin_hide_unrelated_notices' );
[433] Fix | Delete
[434] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function