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.../public_h.../wp-inclu...
File: class-wp-widget.php
* @return string|null
[500] Fix | Delete
*/
[501] Fix | Delete
public function form_callback( $widget_args = 1 ) {
[502] Fix | Delete
if ( is_numeric( $widget_args ) ) {
[503] Fix | Delete
$widget_args = array( 'number' => $widget_args );
[504] Fix | Delete
}
[505] Fix | Delete
[506] Fix | Delete
$widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );
[507] Fix | Delete
$all_instances = $this->get_settings();
[508] Fix | Delete
[509] Fix | Delete
if ( -1 === $widget_args['number'] ) {
[510] Fix | Delete
// We echo out a form where 'number' can be set later.
[511] Fix | Delete
$this->_set( '__i__' );
[512] Fix | Delete
$instance = array();
[513] Fix | Delete
} else {
[514] Fix | Delete
$this->_set( $widget_args['number'] );
[515] Fix | Delete
$instance = $all_instances[ $widget_args['number'] ];
[516] Fix | Delete
}
[517] Fix | Delete
[518] Fix | Delete
/**
[519] Fix | Delete
* Filters the widget instance's settings before displaying the control form.
[520] Fix | Delete
*
[521] Fix | Delete
* Returning false effectively short-circuits display of the control form.
[522] Fix | Delete
*
[523] Fix | Delete
* @since 2.8.0
[524] Fix | Delete
*
[525] Fix | Delete
* @param array $instance The current widget instance's settings.
[526] Fix | Delete
* @param WP_Widget $widget The current widget instance.
[527] Fix | Delete
*/
[528] Fix | Delete
$instance = apply_filters( 'widget_form_callback', $instance, $this );
[529] Fix | Delete
[530] Fix | Delete
$return = null;
[531] Fix | Delete
[532] Fix | Delete
if ( false !== $instance ) {
[533] Fix | Delete
$return = $this->form( $instance );
[534] Fix | Delete
[535] Fix | Delete
/**
[536] Fix | Delete
* Fires at the end of the widget control form.
[537] Fix | Delete
*
[538] Fix | Delete
* Use this hook to add extra fields to the widget form. The hook
[539] Fix | Delete
* is only fired if the value passed to the 'widget_form_callback'
[540] Fix | Delete
* hook is not false.
[541] Fix | Delete
*
[542] Fix | Delete
* Note: If the widget has no form, the text echoed from the default
[543] Fix | Delete
* form method can be hidden using CSS.
[544] Fix | Delete
*
[545] Fix | Delete
* @since 2.8.0
[546] Fix | Delete
*
[547] Fix | Delete
* @param WP_Widget $widget The widget instance (passed by reference).
[548] Fix | Delete
* @param null $return Return null if new fields are added.
[549] Fix | Delete
* @param array $instance An array of the widget's settings.
[550] Fix | Delete
*/
[551] Fix | Delete
do_action_ref_array( 'in_widget_form', array( &$this, &$return, $instance ) );
[552] Fix | Delete
}
[553] Fix | Delete
[554] Fix | Delete
return $return;
[555] Fix | Delete
}
[556] Fix | Delete
[557] Fix | Delete
/**
[558] Fix | Delete
* Registers an instance of the widget class.
[559] Fix | Delete
*
[560] Fix | Delete
* @since 2.8.0
[561] Fix | Delete
*
[562] Fix | Delete
* @param int $number Optional. The unique order number of this widget instance
[563] Fix | Delete
* compared to other instances of the same class. Default -1.
[564] Fix | Delete
*/
[565] Fix | Delete
public function _register_one( $number = -1 ) {
[566] Fix | Delete
wp_register_sidebar_widget(
[567] Fix | Delete
$this->id,
[568] Fix | Delete
$this->name,
[569] Fix | Delete
$this->_get_display_callback(),
[570] Fix | Delete
$this->widget_options,
[571] Fix | Delete
array( 'number' => $number )
[572] Fix | Delete
);
[573] Fix | Delete
[574] Fix | Delete
_register_widget_update_callback(
[575] Fix | Delete
$this->id_base,
[576] Fix | Delete
$this->_get_update_callback(),
[577] Fix | Delete
$this->control_options,
[578] Fix | Delete
array( 'number' => -1 )
[579] Fix | Delete
);
[580] Fix | Delete
[581] Fix | Delete
_register_widget_form_callback(
[582] Fix | Delete
$this->id,
[583] Fix | Delete
$this->name,
[584] Fix | Delete
$this->_get_form_callback(),
[585] Fix | Delete
$this->control_options,
[586] Fix | Delete
array( 'number' => $number )
[587] Fix | Delete
);
[588] Fix | Delete
}
[589] Fix | Delete
[590] Fix | Delete
/**
[591] Fix | Delete
* Saves the settings for all instances of the widget class.
[592] Fix | Delete
*
[593] Fix | Delete
* @since 2.8.0
[594] Fix | Delete
*
[595] Fix | Delete
* @param array $settings Multi-dimensional array of widget instance settings.
[596] Fix | Delete
*/
[597] Fix | Delete
public function save_settings( $settings ) {
[598] Fix | Delete
$settings['_multiwidget'] = 1;
[599] Fix | Delete
update_option( $this->option_name, $settings );
[600] Fix | Delete
}
[601] Fix | Delete
[602] Fix | Delete
/**
[603] Fix | Delete
* Retrieves the settings for all instances of the widget class.
[604] Fix | Delete
*
[605] Fix | Delete
* @since 2.8.0
[606] Fix | Delete
*
[607] Fix | Delete
* @return array Multi-dimensional array of widget instance settings.
[608] Fix | Delete
*/
[609] Fix | Delete
public function get_settings() {
[610] Fix | Delete
[611] Fix | Delete
$settings = get_option( $this->option_name );
[612] Fix | Delete
[613] Fix | Delete
if ( false === $settings ) {
[614] Fix | Delete
$settings = array();
[615] Fix | Delete
if ( isset( $this->alt_option_name ) ) {
[616] Fix | Delete
// Get settings from alternative (legacy) option.
[617] Fix | Delete
$settings = get_option( $this->alt_option_name, array() );
[618] Fix | Delete
[619] Fix | Delete
// Delete the alternative (legacy) option as the new option will be created using `$this->option_name`.
[620] Fix | Delete
delete_option( $this->alt_option_name );
[621] Fix | Delete
}
[622] Fix | Delete
// Save an option so it can be autoloaded next time.
[623] Fix | Delete
$this->save_settings( $settings );
[624] Fix | Delete
}
[625] Fix | Delete
[626] Fix | Delete
if ( ! is_array( $settings ) && ! ( $settings instanceof ArrayObject || $settings instanceof ArrayIterator ) ) {
[627] Fix | Delete
$settings = array();
[628] Fix | Delete
}
[629] Fix | Delete
[630] Fix | Delete
if ( ! empty( $settings ) && ! isset( $settings['_multiwidget'] ) ) {
[631] Fix | Delete
// Old format, convert if single widget.
[632] Fix | Delete
$settings = wp_convert_widget_settings( $this->id_base, $this->option_name, $settings );
[633] Fix | Delete
}
[634] Fix | Delete
[635] Fix | Delete
unset( $settings['_multiwidget'], $settings['__i__'] );
[636] Fix | Delete
[637] Fix | Delete
return $settings;
[638] Fix | Delete
}
[639] Fix | Delete
}
[640] Fix | Delete
[641] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function