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-inclu...
File: class-wp-customize-widgets.php
}
[500] Fix | Delete
[501] Fix | Delete
$this->manager->add_control( $control );
[502] Fix | Delete
[503] Fix | Delete
$new_setting_ids[] = $setting_id;
[504] Fix | Delete
}
[505] Fix | Delete
}
[506] Fix | Delete
[507] Fix | Delete
if ( ! $use_widgets_block_editor ) {
[508] Fix | Delete
// Add a control for each active widget (located in a sidebar).
[509] Fix | Delete
foreach ( $sidebar_widget_ids as $i => $widget_id ) {
[510] Fix | Delete
[511] Fix | Delete
// Skip widgets that may have gone away due to a plugin being deactivated.
[512] Fix | Delete
if ( ! $is_active_sidebar || ! isset( $wp_registered_widgets[ $widget_id ] ) ) {
[513] Fix | Delete
continue;
[514] Fix | Delete
}
[515] Fix | Delete
[516] Fix | Delete
$registered_widget = $wp_registered_widgets[ $widget_id ];
[517] Fix | Delete
$setting_id = $this->get_setting_id( $widget_id );
[518] Fix | Delete
$id_base = $wp_registered_widget_controls[ $widget_id ]['id_base'];
[519] Fix | Delete
[520] Fix | Delete
$control = new WP_Widget_Form_Customize_Control(
[521] Fix | Delete
$this->manager,
[522] Fix | Delete
$setting_id,
[523] Fix | Delete
array(
[524] Fix | Delete
'label' => $registered_widget['name'],
[525] Fix | Delete
'section' => $section_id,
[526] Fix | Delete
'sidebar_id' => $sidebar_id,
[527] Fix | Delete
'widget_id' => $widget_id,
[528] Fix | Delete
'widget_id_base' => $id_base,
[529] Fix | Delete
'priority' => $i,
[530] Fix | Delete
'width' => $wp_registered_widget_controls[ $widget_id ]['width'],
[531] Fix | Delete
'height' => $wp_registered_widget_controls[ $widget_id ]['height'],
[532] Fix | Delete
'is_wide' => $this->is_wide_widget( $widget_id ),
[533] Fix | Delete
)
[534] Fix | Delete
);
[535] Fix | Delete
$this->manager->add_control( $control );
[536] Fix | Delete
}
[537] Fix | Delete
}
[538] Fix | Delete
}
[539] Fix | Delete
[540] Fix | Delete
if ( $this->manager->settings_previewed() ) {
[541] Fix | Delete
foreach ( $new_setting_ids as $new_setting_id ) {
[542] Fix | Delete
$this->manager->get_setting( $new_setting_id )->preview();
[543] Fix | Delete
}
[544] Fix | Delete
}
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
/**
[548] Fix | Delete
* Determines whether the widgets panel is active, based on whether there are sidebars registered.
[549] Fix | Delete
*
[550] Fix | Delete
* @since 4.4.0
[551] Fix | Delete
*
[552] Fix | Delete
* @see WP_Customize_Panel::$active_callback
[553] Fix | Delete
*
[554] Fix | Delete
* @global array $wp_registered_sidebars
[555] Fix | Delete
* @return bool Active.
[556] Fix | Delete
*/
[557] Fix | Delete
public function is_panel_active() {
[558] Fix | Delete
global $wp_registered_sidebars;
[559] Fix | Delete
return ! empty( $wp_registered_sidebars );
[560] Fix | Delete
}
[561] Fix | Delete
[562] Fix | Delete
/**
[563] Fix | Delete
* Converts a widget_id into its corresponding Customizer setting ID (option name).
[564] Fix | Delete
*
[565] Fix | Delete
* @since 3.9.0
[566] Fix | Delete
*
[567] Fix | Delete
* @param string $widget_id Widget ID.
[568] Fix | Delete
* @return string Maybe-parsed widget ID.
[569] Fix | Delete
*/
[570] Fix | Delete
public function get_setting_id( $widget_id ) {
[571] Fix | Delete
$parsed_widget_id = $this->parse_widget_id( $widget_id );
[572] Fix | Delete
$setting_id = sprintf( 'widget_%s', $parsed_widget_id['id_base'] );
[573] Fix | Delete
[574] Fix | Delete
if ( ! is_null( $parsed_widget_id['number'] ) ) {
[575] Fix | Delete
$setting_id .= sprintf( '[%d]', $parsed_widget_id['number'] );
[576] Fix | Delete
}
[577] Fix | Delete
return $setting_id;
[578] Fix | Delete
}
[579] Fix | Delete
[580] Fix | Delete
/**
[581] Fix | Delete
* Determines whether the widget is considered "wide".
[582] Fix | Delete
*
[583] Fix | Delete
* Core widgets which may have controls wider than 250, but can still be shown
[584] Fix | Delete
* in the narrow Customizer panel. The RSS and Text widgets in Core, for example,
[585] Fix | Delete
* have widths of 400 and yet they still render fine in the Customizer panel.
[586] Fix | Delete
*
[587] Fix | Delete
* This method will return all Core widgets as being not wide, but this can be
[588] Fix | Delete
* overridden with the {@see 'is_wide_widget_in_customizer'} filter.
[589] Fix | Delete
*
[590] Fix | Delete
* @since 3.9.0
[591] Fix | Delete
*
[592] Fix | Delete
* @global array $wp_registered_widget_controls
[593] Fix | Delete
*
[594] Fix | Delete
* @param string $widget_id Widget ID.
[595] Fix | Delete
* @return bool Whether or not the widget is a "wide" widget.
[596] Fix | Delete
*/
[597] Fix | Delete
public function is_wide_widget( $widget_id ) {
[598] Fix | Delete
global $wp_registered_widget_controls;
[599] Fix | Delete
[600] Fix | Delete
$parsed_widget_id = $this->parse_widget_id( $widget_id );
[601] Fix | Delete
$width = $wp_registered_widget_controls[ $widget_id ]['width'];
[602] Fix | Delete
$is_core = in_array( $parsed_widget_id['id_base'], $this->core_widget_id_bases, true );
[603] Fix | Delete
$is_wide = ( $width > 250 && ! $is_core );
[604] Fix | Delete
[605] Fix | Delete
/**
[606] Fix | Delete
* Filters whether the given widget is considered "wide".
[607] Fix | Delete
*
[608] Fix | Delete
* @since 3.9.0
[609] Fix | Delete
*
[610] Fix | Delete
* @param bool $is_wide Whether the widget is wide, Default false.
[611] Fix | Delete
* @param string $widget_id Widget ID.
[612] Fix | Delete
*/
[613] Fix | Delete
return apply_filters( 'is_wide_widget_in_customizer', $is_wide, $widget_id );
[614] Fix | Delete
}
[615] Fix | Delete
[616] Fix | Delete
/**
[617] Fix | Delete
* Converts a widget ID into its id_base and number components.
[618] Fix | Delete
*
[619] Fix | Delete
* @since 3.9.0
[620] Fix | Delete
*
[621] Fix | Delete
* @param string $widget_id Widget ID.
[622] Fix | Delete
* @return array Array containing a widget's id_base and number components.
[623] Fix | Delete
*/
[624] Fix | Delete
public function parse_widget_id( $widget_id ) {
[625] Fix | Delete
$parsed = array(
[626] Fix | Delete
'number' => null,
[627] Fix | Delete
'id_base' => null,
[628] Fix | Delete
);
[629] Fix | Delete
[630] Fix | Delete
if ( preg_match( '/^(.+)-(\d+)$/', $widget_id, $matches ) ) {
[631] Fix | Delete
$parsed['id_base'] = $matches[1];
[632] Fix | Delete
$parsed['number'] = (int) $matches[2];
[633] Fix | Delete
} else {
[634] Fix | Delete
// Likely an old single widget.
[635] Fix | Delete
$parsed['id_base'] = $widget_id;
[636] Fix | Delete
}
[637] Fix | Delete
return $parsed;
[638] Fix | Delete
}
[639] Fix | Delete
[640] Fix | Delete
/**
[641] Fix | Delete
* Converts a widget setting ID (option path) to its id_base and number components.
[642] Fix | Delete
*
[643] Fix | Delete
* @since 3.9.0
[644] Fix | Delete
*
[645] Fix | Delete
* @param string $setting_id Widget setting ID.
[646] Fix | Delete
* @return array|WP_Error Array containing a widget's id_base and number components,
[647] Fix | Delete
* or a WP_Error object.
[648] Fix | Delete
*/
[649] Fix | Delete
public function parse_widget_setting_id( $setting_id ) {
[650] Fix | Delete
if ( ! preg_match( '/^(widget_(.+?))(?:\[(\d+)\])?$/', $setting_id, $matches ) ) {
[651] Fix | Delete
return new WP_Error( 'widget_setting_invalid_id' );
[652] Fix | Delete
}
[653] Fix | Delete
[654] Fix | Delete
$id_base = $matches[2];
[655] Fix | Delete
$number = isset( $matches[3] ) ? (int) $matches[3] : null;
[656] Fix | Delete
[657] Fix | Delete
return compact( 'id_base', 'number' );
[658] Fix | Delete
}
[659] Fix | Delete
[660] Fix | Delete
/**
[661] Fix | Delete
* Calls admin_print_styles-widgets.php and admin_print_styles hooks to
[662] Fix | Delete
* allow custom styles from plugins.
[663] Fix | Delete
*
[664] Fix | Delete
* @since 3.9.0
[665] Fix | Delete
*/
[666] Fix | Delete
public function print_styles() {
[667] Fix | Delete
/** This action is documented in wp-admin/admin-header.php */
[668] Fix | Delete
do_action( 'admin_print_styles-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[669] Fix | Delete
[670] Fix | Delete
/** This action is documented in wp-admin/admin-header.php */
[671] Fix | Delete
do_action( 'admin_print_styles' );
[672] Fix | Delete
}
[673] Fix | Delete
[674] Fix | Delete
/**
[675] Fix | Delete
* Calls admin_print_scripts-widgets.php and admin_print_scripts hooks to
[676] Fix | Delete
* allow custom scripts from plugins.
[677] Fix | Delete
*
[678] Fix | Delete
* @since 3.9.0
[679] Fix | Delete
*/
[680] Fix | Delete
public function print_scripts() {
[681] Fix | Delete
/** This action is documented in wp-admin/admin-header.php */
[682] Fix | Delete
do_action( 'admin_print_scripts-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[683] Fix | Delete
[684] Fix | Delete
/** This action is documented in wp-admin/admin-header.php */
[685] Fix | Delete
do_action( 'admin_print_scripts' );
[686] Fix | Delete
}
[687] Fix | Delete
[688] Fix | Delete
/**
[689] Fix | Delete
* Enqueues scripts and styles for Customizer panel and export data to JavaScript.
[690] Fix | Delete
*
[691] Fix | Delete
* @since 3.9.0
[692] Fix | Delete
*
[693] Fix | Delete
* @global WP_Scripts $wp_scripts
[694] Fix | Delete
* @global array $wp_registered_sidebars
[695] Fix | Delete
* @global array $wp_registered_widgets
[696] Fix | Delete
*/
[697] Fix | Delete
public function enqueue_scripts() {
[698] Fix | Delete
global $wp_scripts, $wp_registered_sidebars, $wp_registered_widgets;
[699] Fix | Delete
[700] Fix | Delete
wp_enqueue_style( 'customize-widgets' );
[701] Fix | Delete
wp_enqueue_script( 'customize-widgets' );
[702] Fix | Delete
[703] Fix | Delete
/** This action is documented in wp-admin/admin-header.php */
[704] Fix | Delete
do_action( 'admin_enqueue_scripts', 'widgets.php' );
[705] Fix | Delete
[706] Fix | Delete
/*
[707] Fix | Delete
* Export available widgets with control_tpl removed from model
[708] Fix | Delete
* since plugins need templates to be in the DOM.
[709] Fix | Delete
*/
[710] Fix | Delete
$available_widgets = array();
[711] Fix | Delete
[712] Fix | Delete
foreach ( $this->get_available_widgets() as $available_widget ) {
[713] Fix | Delete
unset( $available_widget['control_tpl'] );
[714] Fix | Delete
$available_widgets[] = $available_widget;
[715] Fix | Delete
}
[716] Fix | Delete
[717] Fix | Delete
$widget_reorder_nav_tpl = sprintf(
[718] Fix | Delete
'<div class="widget-reorder-nav"><span class="move-widget" tabindex="0">%1$s</span><span class="move-widget-down" tabindex="0">%2$s</span><span class="move-widget-up" tabindex="0">%3$s</span></div>',
[719] Fix | Delete
__( 'Move to another area&hellip;' ),
[720] Fix | Delete
__( 'Move down' ),
[721] Fix | Delete
__( 'Move up' )
[722] Fix | Delete
);
[723] Fix | Delete
[724] Fix | Delete
$move_widget_area_tpl = str_replace(
[725] Fix | Delete
array( '{description}', '{btn}' ),
[726] Fix | Delete
array(
[727] Fix | Delete
__( 'Select an area to move this widget into:' ),
[728] Fix | Delete
_x( 'Move', 'Move widget' ),
[729] Fix | Delete
),
[730] Fix | Delete
'<div class="move-widget-area">
[731] Fix | Delete
<p class="description">{description}</p>
[732] Fix | Delete
<ul class="widget-area-select">
[733] Fix | Delete
<% _.each( sidebars, function ( sidebar ){ %>
[734] Fix | Delete
<li class="" data-id="<%- sidebar.id %>" title="<%- sidebar.description %>" tabindex="0"><%- sidebar.name %></li>
[735] Fix | Delete
<% }); %>
[736] Fix | Delete
</ul>
[737] Fix | Delete
<div class="move-widget-actions">
[738] Fix | Delete
<button class="move-widget-btn button" type="button">{btn}</button>
[739] Fix | Delete
</div>
[740] Fix | Delete
</div>'
[741] Fix | Delete
);
[742] Fix | Delete
[743] Fix | Delete
/*
[744] Fix | Delete
* Gather all strings in PHP that may be needed by JS on the client.
[745] Fix | Delete
* Once JS i18n is implemented (in #20491), this can be removed.
[746] Fix | Delete
*/
[747] Fix | Delete
$some_non_rendered_areas_messages = array();
[748] Fix | Delete
$some_non_rendered_areas_messages[1] = html_entity_decode(
[749] Fix | Delete
__( 'Your theme has 1 other widget area, but this particular page does not display it.' ),
[750] Fix | Delete
ENT_QUOTES,
[751] Fix | Delete
get_bloginfo( 'charset' )
[752] Fix | Delete
);
[753] Fix | Delete
$registered_sidebar_count = count( $wp_registered_sidebars );
[754] Fix | Delete
for ( $non_rendered_count = 2; $non_rendered_count < $registered_sidebar_count; $non_rendered_count++ ) {
[755] Fix | Delete
$some_non_rendered_areas_messages[ $non_rendered_count ] = html_entity_decode(
[756] Fix | Delete
sprintf(
[757] Fix | Delete
/* translators: %s: The number of other widget areas registered but not rendered. */
[758] Fix | Delete
_n(
[759] Fix | Delete
'Your theme has %s other widget area, but this particular page does not display it.',
[760] Fix | Delete
'Your theme has %s other widget areas, but this particular page does not display them.',
[761] Fix | Delete
$non_rendered_count
[762] Fix | Delete
),
[763] Fix | Delete
number_format_i18n( $non_rendered_count )
[764] Fix | Delete
),
[765] Fix | Delete
ENT_QUOTES,
[766] Fix | Delete
get_bloginfo( 'charset' )
[767] Fix | Delete
);
[768] Fix | Delete
}
[769] Fix | Delete
[770] Fix | Delete
if ( 1 === $registered_sidebar_count ) {
[771] Fix | Delete
$no_areas_shown_message = html_entity_decode(
[772] Fix | Delete
sprintf(
[773] Fix | Delete
__( 'Your theme has 1 widget area, but this particular page does not display it.' )
[774] Fix | Delete
),
[775] Fix | Delete
ENT_QUOTES,
[776] Fix | Delete
get_bloginfo( 'charset' )
[777] Fix | Delete
);
[778] Fix | Delete
} else {
[779] Fix | Delete
$no_areas_shown_message = html_entity_decode(
[780] Fix | Delete
sprintf(
[781] Fix | Delete
/* translators: %s: The total number of widget areas registered. */
[782] Fix | Delete
_n(
[783] Fix | Delete
'Your theme has %s widget area, but this particular page does not display it.',
[784] Fix | Delete
'Your theme has %s widget areas, but this particular page does not display them.',
[785] Fix | Delete
$registered_sidebar_count
[786] Fix | Delete
),
[787] Fix | Delete
number_format_i18n( $registered_sidebar_count )
[788] Fix | Delete
),
[789] Fix | Delete
ENT_QUOTES,
[790] Fix | Delete
get_bloginfo( 'charset' )
[791] Fix | Delete
);
[792] Fix | Delete
}
[793] Fix | Delete
[794] Fix | Delete
$settings = array(
[795] Fix | Delete
'registeredSidebars' => array_values( $wp_registered_sidebars ),
[796] Fix | Delete
'registeredWidgets' => $wp_registered_widgets,
[797] Fix | Delete
'availableWidgets' => $available_widgets, // @todo Merge this with registered_widgets.
[798] Fix | Delete
'l10n' => array(
[799] Fix | Delete
'saveBtnLabel' => __( 'Apply' ),
[800] Fix | Delete
'saveBtnTooltip' => __( 'Save and preview changes before publishing them.' ),
[801] Fix | Delete
'removeBtnLabel' => __( 'Remove' ),
[802] Fix | Delete
'removeBtnTooltip' => __( 'Keep widget settings and move it to the inactive widgets' ),
[803] Fix | Delete
'error' => __( 'An error has occurred. Please reload the page and try again.' ),
[804] Fix | Delete
'widgetMovedUp' => __( 'Widget moved up' ),
[805] Fix | Delete
'widgetMovedDown' => __( 'Widget moved down' ),
[806] Fix | Delete
'navigatePreview' => __( 'You can navigate to other pages on your site while using the Customizer to view and edit the widgets displayed on those pages.' ),
[807] Fix | Delete
'someAreasShown' => $some_non_rendered_areas_messages,
[808] Fix | Delete
'noAreasShown' => $no_areas_shown_message,
[809] Fix | Delete
'reorderModeOn' => __( 'Reorder mode enabled' ),
[810] Fix | Delete
'reorderModeOff' => __( 'Reorder mode closed' ),
[811] Fix | Delete
'reorderLabelOn' => esc_attr__( 'Reorder widgets' ),
[812] Fix | Delete
/* translators: %d: The number of widgets found. */
[813] Fix | Delete
'widgetsFound' => __( 'Number of widgets found: %d' ),
[814] Fix | Delete
'noWidgetsFound' => __( 'No widgets found.' ),
[815] Fix | Delete
),
[816] Fix | Delete
'tpl' => array(
[817] Fix | Delete
'widgetReorderNav' => $widget_reorder_nav_tpl,
[818] Fix | Delete
'moveWidgetArea' => $move_widget_area_tpl,
[819] Fix | Delete
),
[820] Fix | Delete
'selectiveRefreshableWidgets' => $this->get_selective_refreshable_widgets(),
[821] Fix | Delete
);
[822] Fix | Delete
[823] Fix | Delete
foreach ( $settings['registeredWidgets'] as &$registered_widget ) {
[824] Fix | Delete
unset( $registered_widget['callback'] ); // May not be JSON-serializable.
[825] Fix | Delete
}
[826] Fix | Delete
[827] Fix | Delete
$wp_scripts->add_data(
[828] Fix | Delete
'customize-widgets',
[829] Fix | Delete
'data',
[830] Fix | Delete
sprintf( 'var _wpCustomizeWidgetsSettings = %s;', wp_json_encode( $settings ) )
[831] Fix | Delete
);
[832] Fix | Delete
[833] Fix | Delete
/*
[834] Fix | Delete
* TODO: Update 'wp-customize-widgets' to not rely so much on things in
[835] Fix | Delete
* 'customize-widgets'. This will let us skip most of the above and not
[836] Fix | Delete
* enqueue 'customize-widgets' which saves bytes.
[837] Fix | Delete
*/
[838] Fix | Delete
[839] Fix | Delete
if ( wp_use_widgets_block_editor() ) {
[840] Fix | Delete
$block_editor_context = new WP_Block_Editor_Context(
[841] Fix | Delete
array(
[842] Fix | Delete
'name' => 'core/customize-widgets',
[843] Fix | Delete
)
[844] Fix | Delete
);
[845] Fix | Delete
[846] Fix | Delete
$editor_settings = get_block_editor_settings(
[847] Fix | Delete
get_legacy_widget_block_editor_settings(),
[848] Fix | Delete
$block_editor_context
[849] Fix | Delete
);
[850] Fix | Delete
[851] Fix | Delete
wp_add_inline_script(
[852] Fix | Delete
'wp-customize-widgets',
[853] Fix | Delete
sprintf(
[854] Fix | Delete
'wp.domReady( function() {
[855] Fix | Delete
wp.customizeWidgets.initialize( "widgets-customizer", %s );
[856] Fix | Delete
} );',
[857] Fix | Delete
wp_json_encode( $editor_settings )
[858] Fix | Delete
)
[859] Fix | Delete
);
[860] Fix | Delete
[861] Fix | Delete
// Preload server-registered block schemas.
[862] Fix | Delete
wp_add_inline_script(
[863] Fix | Delete
'wp-blocks',
[864] Fix | Delete
'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');'
[865] Fix | Delete
);
[866] Fix | Delete
[867] Fix | Delete
wp_add_inline_script(
[868] Fix | Delete
'wp-blocks',
[869] Fix | Delete
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ) ) ),
[870] Fix | Delete
'after'
[871] Fix | Delete
);
[872] Fix | Delete
[873] Fix | Delete
wp_enqueue_script( 'wp-customize-widgets' );
[874] Fix | Delete
wp_enqueue_style( 'wp-customize-widgets' );
[875] Fix | Delete
[876] Fix | Delete
/** This action is documented in edit-form-blocks.php */
[877] Fix | Delete
do_action( 'enqueue_block_editor_assets' );
[878] Fix | Delete
}
[879] Fix | Delete
}
[880] Fix | Delete
[881] Fix | Delete
/**
[882] Fix | Delete
* Renders the widget form control templates into the DOM.
[883] Fix | Delete
*
[884] Fix | Delete
* @since 3.9.0
[885] Fix | Delete
*/
[886] Fix | Delete
public function output_widget_control_templates() {
[887] Fix | Delete
?>
[888] Fix | Delete
<div id="widgets-left"><!-- compatibility with JS which looks for widget templates here -->
[889] Fix | Delete
<div id="available-widgets">
[890] Fix | Delete
<div class="customize-section-title">
[891] Fix | Delete
<button class="customize-section-back" tabindex="-1">
[892] Fix | Delete
<span class="screen-reader-text">
[893] Fix | Delete
<?php
[894] Fix | Delete
/* translators: Hidden accessibility text. */
[895] Fix | Delete
_e( 'Back' );
[896] Fix | Delete
?>
[897] Fix | Delete
</span>
[898] Fix | Delete
</button>
[899] Fix | Delete
<h3>
[900] Fix | Delete
<span class="customize-action">
[901] Fix | Delete
<?php
[902] Fix | Delete
/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
[903] Fix | Delete
printf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );
[904] Fix | Delete
?>
[905] Fix | Delete
</span>
[906] Fix | Delete
<?php _e( 'Add a Widget' ); ?>
[907] Fix | Delete
</h3>
[908] Fix | Delete
</div>
[909] Fix | Delete
<div id="available-widgets-filter">
[910] Fix | Delete
<label for="widgets-search">
[911] Fix | Delete
<?php
[912] Fix | Delete
/* translators: Hidden accessibility text. */
[913] Fix | Delete
_e( 'Search Widgets' );
[914] Fix | Delete
?>
[915] Fix | Delete
</label>
[916] Fix | Delete
<input type="text" id="widgets-search" aria-describedby="widgets-search-desc" />
[917] Fix | Delete
<div class="search-icon" aria-hidden="true"></div>
[918] Fix | Delete
<button type="button" class="clear-results"><span class="screen-reader-text">
[919] Fix | Delete
<?php
[920] Fix | Delete
/* translators: Hidden accessibility text. */
[921] Fix | Delete
_e( 'Clear Results' );
[922] Fix | Delete
?>
[923] Fix | Delete
</span></button>
[924] Fix | Delete
<p class="screen-reader-text" id="widgets-search-desc">
[925] Fix | Delete
<?php
[926] Fix | Delete
/* translators: Hidden accessibility text. */
[927] Fix | Delete
_e( 'The search results will be updated as you type.' );
[928] Fix | Delete
?>
[929] Fix | Delete
</p>
[930] Fix | Delete
</div>
[931] Fix | Delete
<div id="available-widgets-list">
[932] Fix | Delete
<?php foreach ( $this->get_available_widgets() as $available_widget ) : ?>
[933] Fix | Delete
<div id="widget-tpl-<?php echo esc_attr( $available_widget['id'] ); ?>" data-widget-id="<?php echo esc_attr( $available_widget['id'] ); ?>" class="widget-tpl <?php echo esc_attr( $available_widget['id'] ); ?>" tabindex="0">
[934] Fix | Delete
<?php echo $available_widget['control_tpl']; ?>
[935] Fix | Delete
</div>
[936] Fix | Delete
<?php endforeach; ?>
[937] Fix | Delete
<p class="no-widgets-found-message"><?php _e( 'No widgets found.' ); ?></p>
[938] Fix | Delete
</div><!-- #available-widgets-list -->
[939] Fix | Delete
</div><!-- #available-widgets -->
[940] Fix | Delete
</div><!-- #widgets-left -->
[941] Fix | Delete
<?php
[942] Fix | Delete
}
[943] Fix | Delete
[944] Fix | Delete
/**
[945] Fix | Delete
* Calls admin_print_footer_scripts and admin_print_scripts hooks to
[946] Fix | Delete
* allow custom scripts from plugins.
[947] Fix | Delete
*
[948] Fix | Delete
* @since 3.9.0
[949] Fix | Delete
*/
[950] Fix | Delete
public function print_footer_scripts() {
[951] Fix | Delete
/** This action is documented in wp-admin/admin-footer.php */
[952] Fix | Delete
do_action( 'admin_print_footer_scripts-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[953] Fix | Delete
[954] Fix | Delete
/** This action is documented in wp-admin/admin-footer.php */
[955] Fix | Delete
do_action( 'admin_print_footer_scripts' );
[956] Fix | Delete
[957] Fix | Delete
/** This action is documented in wp-admin/admin-footer.php */
[958] Fix | Delete
do_action( 'admin_footer-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[959] Fix | Delete
}
[960] Fix | Delete
[961] Fix | Delete
/**
[962] Fix | Delete
* Retrieves common arguments to supply when constructing a Customizer setting.
[963] Fix | Delete
*
[964] Fix | Delete
* @since 3.9.0
[965] Fix | Delete
*
[966] Fix | Delete
* @param string $id Widget setting ID.
[967] Fix | Delete
* @param array $overrides Array of setting overrides.
[968] Fix | Delete
* @return array Possibly modified setting arguments.
[969] Fix | Delete
*/
[970] Fix | Delete
public function get_setting_args( $id, $overrides = array() ) {
[971] Fix | Delete
$args = array(
[972] Fix | Delete
'type' => 'option',
[973] Fix | Delete
'capability' => 'edit_theme_options',
[974] Fix | Delete
'default' => array(),
[975] Fix | Delete
);
[976] Fix | Delete
[977] Fix | Delete
if ( preg_match( $this->setting_id_patterns['sidebar_widgets'], $id, $matches ) ) {
[978] Fix | Delete
$args['sanitize_callback'] = array( $this, 'sanitize_sidebar_widgets' );
[979] Fix | Delete
$args['sanitize_js_callback'] = array( $this, 'sanitize_sidebar_widgets_js_instance' );
[980] Fix | Delete
$args['transport'] = current_theme_supports( 'customize-selective-refresh-widgets' ) ? 'postMessage' : 'refresh';
[981] Fix | Delete
} elseif ( preg_match( $this->setting_id_patterns['widget_instance'], $id, $matches ) ) {
[982] Fix | Delete
$id_base = $matches['id_base'];
[983] Fix | Delete
$args['sanitize_callback'] = function ( $value ) use ( $id_base ) {
[984] Fix | Delete
return $this->sanitize_widget_instance( $value, $id_base );
[985] Fix | Delete
};
[986] Fix | Delete
$args['sanitize_js_callback'] = function ( $value ) use ( $id_base ) {
[987] Fix | Delete
return $this->sanitize_widget_js_instance( $value, $id_base );
[988] Fix | Delete
};
[989] Fix | Delete
$args['transport'] = $this->is_widget_selective_refreshable( $matches['id_base'] ) ? 'postMessage' : 'refresh';
[990] Fix | Delete
}
[991] Fix | Delete
[992] Fix | Delete
$args = array_merge( $args, $overrides );
[993] Fix | Delete
[994] Fix | Delete
/**
[995] Fix | Delete
* Filters the common arguments supplied when constructing a Customizer setting.
[996] Fix | Delete
*
[997] Fix | Delete
* @since 3.9.0
[998] Fix | Delete
*
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function