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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/redux-fr.../sample
File: sample-config.php
)
[500] Fix | Delete
);
[501] Fix | Delete
[502] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/disabling/disable-field.php';
[503] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/disabling/disable-section.php';
[504] Fix | Delete
[505] Fix | Delete
// -> START Extensions.
[506] Fix | Delete
Redux::set_section(
[507] Fix | Delete
$opt_name,
[508] Fix | Delete
array(
[509] Fix | Delete
'title' => esc_html__( 'Redux Extensions', 'your-textdomain-here' ),
[510] Fix | Delete
'id' => 'redux-extensions',
[511] Fix | Delete
'icon' => 'el el-redux',
[512] Fix | Delete
'class' => 'pro_highlight',
[513] Fix | Delete
'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/" target="_blank">https://devs.redux.io/core-extensions/</a>',
[514] Fix | Delete
)
[515] Fix | Delete
);
[516] Fix | Delete
[517] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/accordion.php';
[518] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/color-scheme.php';
[519] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/custom-fonts.php';
[520] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/google-maps.php';
[521] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/icon-select.php';
[522] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/js-button.php';
[523] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/repeater.php';
[524] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/search.php';
[525] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/shortcodes.php';
[526] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/social-profiles.php';
[527] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/tabbed.php';
[528] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/widget-areas.php';
[529] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/taxonomy.php';
[530] Fix | Delete
require_once Redux_Core::$dir . '../sample/sections/extensions/users.php';
[531] Fix | Delete
[532] Fix | Delete
/**
[533] Fix | Delete
* Metaboxes
[534] Fix | Delete
*/
[535] Fix | Delete
require_once Redux_Core::$dir . '../sample/metaboxes.php';
[536] Fix | Delete
[537] Fix | Delete
/**
[538] Fix | Delete
* Raw README
[539] Fix | Delete
*/
[540] Fix | Delete
if ( file_exists( $dir . '/../README.md' ) ) {
[541] Fix | Delete
$section = array(
[542] Fix | Delete
'icon' => 'el el-list-alt',
[543] Fix | Delete
'title' => esc_html__( 'Documentation', 'your-textdomain-here' ),
[544] Fix | Delete
'fields' => array(
[545] Fix | Delete
array(
[546] Fix | Delete
'id' => 'opt-raw-documentation',
[547] Fix | Delete
'type' => 'raw',
[548] Fix | Delete
'markdown' => true,
[549] Fix | Delete
'content_path' => __DIR__ . '/../README.md', // FULL PATH, not relative, please.
[550] Fix | Delete
),
[551] Fix | Delete
),
[552] Fix | Delete
);
[553] Fix | Delete
[554] Fix | Delete
Redux::set_section( $opt_name, $section );
[555] Fix | Delete
}
[556] Fix | Delete
[557] Fix | Delete
Redux::set_section(
[558] Fix | Delete
$opt_name,
[559] Fix | Delete
array(
[560] Fix | Delete
'icon' => 'el el-list-alt',
[561] Fix | Delete
'title' => esc_html__( 'Customizer Only', 'your-textdomain-here' ),
[562] Fix | Delete
'desc' => '<p class="description">' . esc_html__( 'This Section should be visible only in Customizer', 'your-textdomain-here' ) . '</p>',
[563] Fix | Delete
'customizer_only' => true,
[564] Fix | Delete
'fields' => array(
[565] Fix | Delete
array(
[566] Fix | Delete
'id' => 'opt-customizer-only',
[567] Fix | Delete
'type' => 'select',
[568] Fix | Delete
'title' => esc_html__( 'Customizer Only Option', 'your-textdomain-here' ),
[569] Fix | Delete
'subtitle' => esc_html__( 'The subtitle is NOT visible in customizer', 'your-textdomain-here' ),
[570] Fix | Delete
'desc' => esc_html__( 'The field desc is NOT visible in customizer.', 'your-textdomain-here' ),
[571] Fix | Delete
'customizer_only' => true,
[572] Fix | Delete
'options' => array(
[573] Fix | Delete
'1' => esc_html__( 'Opt 1', 'your-textdomain-here' ),
[574] Fix | Delete
'2' => esc_html__( 'Opt 2', 'your-textdomain-here' ),
[575] Fix | Delete
'3' => esc_html__( 'Opt 3', 'your-textdomain-here' ),
[576] Fix | Delete
),
[577] Fix | Delete
'default' => '2',
[578] Fix | Delete
),
[579] Fix | Delete
),
[580] Fix | Delete
)
[581] Fix | Delete
);
[582] Fix | Delete
[583] Fix | Delete
/*
[584] Fix | Delete
* <--- END SECTIONS
[585] Fix | Delete
*/
[586] Fix | Delete
[587] Fix | Delete
/*
[588] Fix | Delete
* YOU MUST PREFIX THE FUNCTIONS BELOW AND ACTION FUNCTION CALLS OR OTHER CONFIGS MAY OVERRIDE YOUR CODE.
[589] Fix | Delete
*/
[590] Fix | Delete
[591] Fix | Delete
/*
[592] Fix | Delete
* --> Action hook examples.
[593] Fix | Delete
*/
[594] Fix | Delete
[595] Fix | Delete
// Function to test the compiler hook and demo CSS output.
[596] Fix | Delete
// Above 10 is a priority, but 2 is necessary to include the dynamically generated CSS to be sent to the function.
[597] Fix | Delete
// add_filter('redux/options/' . $opt_name . '/compiler', 'compiler_action', 10, 3);
[598] Fix | Delete
//
[599] Fix | Delete
// Change the arguments after they've been declared, but before the panel is created.
[600] Fix | Delete
// add_filter('redux/options/' . $opt_name . '/args', 'change_arguments' );
[601] Fix | Delete
//
[602] Fix | Delete
// Change the default value of a field after it's been set, but before it's been used.
[603] Fix | Delete
// add_filter('redux/options/' . $opt_name . '/defaults', 'change_defaults' );
[604] Fix | Delete
//
[605] Fix | Delete
// Dynamically add a section.
[606] Fix | Delete
// It can be also used to modify sections/fields.
[607] Fix | Delete
// add_filter('redux/options/' . $opt_name . '/sections', 'dynamic_section');
[608] Fix | Delete
// .
[609] Fix | Delete
if ( ! function_exists( 'compiler_action' ) ) {
[610] Fix | Delete
/**
[611] Fix | Delete
* This is a test function that will let you see when the compiler hook occurs.
[612] Fix | Delete
* It only runs if a field's value has changed and compiler=>true is set.
[613] Fix | Delete
*
[614] Fix | Delete
* @param array $options Options values.
[615] Fix | Delete
* @param string $css Compiler selector CSS values compiler => array( CSS SELECTORS ).
[616] Fix | Delete
* @param array $changed_values Any values changed since last save.
[617] Fix | Delete
*/
[618] Fix | Delete
function compiler_action( array $options, string $css, array $changed_values ) {
[619] Fix | Delete
echo '<h1>The compiler hook has run!</h1>';
[620] Fix | Delete
echo '<pre>';
[621] Fix | Delete
// phpcs:ignore WordPress.PHP.DevelopmentFunctions
[622] Fix | Delete
print_r( $changed_values ); // Values that have changed since the last save.
[623] Fix | Delete
// echo '<br/>';
[624] Fix | Delete
// print_r($options); //Option values.
[625] Fix | Delete
// echo '<br/>';
[626] Fix | Delete
// print_r($css); // Compiler selector CSS values compiler => array( CSS SELECTORS ).
[627] Fix | Delete
echo '</pre>';
[628] Fix | Delete
}
[629] Fix | Delete
}
[630] Fix | Delete
[631] Fix | Delete
if ( ! function_exists( 'redux_validate_callback_function' ) ) {
[632] Fix | Delete
/**
[633] Fix | Delete
* Custom function for the callback validation referenced above
[634] Fix | Delete
*
[635] Fix | Delete
* @param array $field Field array.
[636] Fix | Delete
* @param mixed $value New value.
[637] Fix | Delete
* @param mixed $existing_value Existing value.
[638] Fix | Delete
*
[639] Fix | Delete
* @return array
[640] Fix | Delete
*/
[641] Fix | Delete
function redux_validate_callback_function( array $field, $value, $existing_value ): array {
[642] Fix | Delete
$error = false;
[643] Fix | Delete
$warning = false;
[644] Fix | Delete
[645] Fix | Delete
// Do your validation.
[646] Fix | Delete
if ( 1 === (int) $value ) {
[647] Fix | Delete
$error = true;
[648] Fix | Delete
$value = $existing_value;
[649] Fix | Delete
} elseif ( 2 === (int) $value ) {
[650] Fix | Delete
$warning = true;
[651] Fix | Delete
$value = $existing_value;
[652] Fix | Delete
}
[653] Fix | Delete
[654] Fix | Delete
$return['value'] = $value;
[655] Fix | Delete
[656] Fix | Delete
if ( true === $error ) {
[657] Fix | Delete
$field['msg'] = 'your custom error message';
[658] Fix | Delete
$return['error'] = $field;
[659] Fix | Delete
}
[660] Fix | Delete
[661] Fix | Delete
if ( true === $warning ) {
[662] Fix | Delete
$field['msg'] = 'your custom warning message';
[663] Fix | Delete
$return['warning'] = $field;
[664] Fix | Delete
}
[665] Fix | Delete
[666] Fix | Delete
return $return;
[667] Fix | Delete
}
[668] Fix | Delete
}
[669] Fix | Delete
[670] Fix | Delete
[671] Fix | Delete
if ( ! function_exists( 'dynamic_section' ) ) {
[672] Fix | Delete
/**
[673] Fix | Delete
* Custom function for filtering the section array.
[674] Fix | Delete
* Good for child themes to override or add to the sections.
[675] Fix | Delete
* Simply include this function in the child themes functions.php file.
[676] Fix | Delete
* NOTE: the defined constants for URLs and directories will NOT be available at this point in a child theme,
[677] Fix | Delete
* so you must use get_template_directory_uri() if you want to use any of the built-in icons.
[678] Fix | Delete
*
[679] Fix | Delete
* @param array $sections Section array.
[680] Fix | Delete
*
[681] Fix | Delete
* @return array
[682] Fix | Delete
*/
[683] Fix | Delete
function dynamic_section( array $sections ): array {
[684] Fix | Delete
$sections[] = array(
[685] Fix | Delete
'title' => esc_html__( 'Section via hook', 'your-textdomain-here' ),
[686] Fix | Delete
'desc' => '<p class="description">' . esc_html__( 'This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.', 'your-textdomain-here' ) . '</p>',
[687] Fix | Delete
'icon' => 'el el-paper-clip',
[688] Fix | Delete
[689] Fix | Delete
// Leave this as a blank section, no options just some intro text set above.
[690] Fix | Delete
'fields' => array(),
[691] Fix | Delete
);
[692] Fix | Delete
[693] Fix | Delete
return $sections;
[694] Fix | Delete
}
[695] Fix | Delete
}
[696] Fix | Delete
[697] Fix | Delete
if ( ! function_exists( 'change_arguments' ) ) {
[698] Fix | Delete
/**
[699] Fix | Delete
* Filter hook for filtering the args.
[700] Fix | Delete
* Good for child themes to override or add to the args array.
[701] Fix | Delete
* It can also be used in other functions.
[702] Fix | Delete
*
[703] Fix | Delete
* @param array $args Global arguments array.
[704] Fix | Delete
*
[705] Fix | Delete
* @return array
[706] Fix | Delete
*/
[707] Fix | Delete
function change_arguments( array $args ): array {
[708] Fix | Delete
$args['dev_mode'] = true;
[709] Fix | Delete
[710] Fix | Delete
return $args;
[711] Fix | Delete
}
[712] Fix | Delete
}
[713] Fix | Delete
[714] Fix | Delete
if ( ! function_exists( 'change_defaults' ) ) {
[715] Fix | Delete
/**
[716] Fix | Delete
* Filter hook for filtering the default value of any given field. Very useful in development mode.
[717] Fix | Delete
*
[718] Fix | Delete
* @param array $defaults Default value array.
[719] Fix | Delete
*
[720] Fix | Delete
* @return array
[721] Fix | Delete
*/
[722] Fix | Delete
function change_defaults( array $defaults ): array {
[723] Fix | Delete
$defaults['str_replace'] = esc_html__( 'Testing filter hook!', 'your-textdomain-here' );
[724] Fix | Delete
[725] Fix | Delete
return $defaults;
[726] Fix | Delete
}
[727] Fix | Delete
}
[728] Fix | Delete
[729] Fix | Delete
if ( ! function_exists( 'redux_custom_sanitize' ) ) {
[730] Fix | Delete
/**
[731] Fix | Delete
* Function to be used if the field sanitizes argument.
[732] Fix | Delete
* Return value MUST be formatted or cleaned text to display.
[733] Fix | Delete
*
[734] Fix | Delete
* @param string $value Value to evaluate or clean. Required.
[735] Fix | Delete
*
[736] Fix | Delete
* @return string
[737] Fix | Delete
*/
[738] Fix | Delete
function redux_custom_sanitize( string $value ): string {
[739] Fix | Delete
$return = '';
[740] Fix | Delete
[741] Fix | Delete
foreach ( explode( ' ', $value ) as $w ) {
[742] Fix | Delete
foreach ( str_split( $w ) as $k => $v ) {
[743] Fix | Delete
if ( ( $k + 1 ) % 2 !== 0 && ctype_alpha( $v ) ) {
[744] Fix | Delete
$return .= mb_strtoupper( $v );
[745] Fix | Delete
} else {
[746] Fix | Delete
$return .= $v;
[747] Fix | Delete
}
[748] Fix | Delete
}
[749] Fix | Delete
[750] Fix | Delete
$return .= ' ';
[751] Fix | Delete
}
[752] Fix | Delete
[753] Fix | Delete
return $return;
[754] Fix | Delete
}
[755] Fix | Delete
}
[756] Fix | Delete
[757] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function