wppaste
WordPress

wp_widget_rss_form( array|string $args, array $inputs = null )

Since
2.5.0
Source
wp-includes/widgets.php:1710
Displays RSS widget options form.

Description

The options for what fields are displayed for the RSS form are all booleans and are as follows: 'url', 'title', 'items', 'show_summary', 'show_author', 'show_date'.

Compatibility

WordPress
since 2.5.0
PHP
7.4–8.6-dev
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.

Parameters

$argsarray|string
Values for input fields.
$inputsarrayoptional
Override default display options.Default: null

Performance profile

How much work a call to wp_widget_rss_form() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.

Cost class
Light

Touches nothing outside its own arguments.

Scaling
Scales with input

The body loops, so the work grows with what you pass in.

Instructions
72–199

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 262.

Plugin surface
None

Nothing here hands control to plugin code.

Called by
2

2 places in core call this, so the cost is paid more often than your own code shows.

What it touches

  • hookthird-party callbacksapply_filters()one call below wp_widget_rss_form()

Further down the call graph this can also reach option, cache, serialize, query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 64 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_widget_rss_form() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
!isset($args) && empty($args) && !$inputs72–83wp_parse_args(), esc_attr(), array_keys()
!isset($args) && !empty($args) && !$inputs85–96wp_parse_args(), __(), esc_html(), esc_attr(), array_keys()
!isset($args) && empty($args) && !$i88–99wp_parse_args(), esc_attr(), _e(), array_keys()
!isset($args) && empty($args)90–101wp_parse_args(), esc_attr(), _e(), esc_attr(), array_keys()
!isset($args) && empty($args)90–101wp_parse_args(), esc_attr(), _e(), esc_url(), array_keys()
!isset($args) && empty($args)93–100wp_parse_args(), esc_attr(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i101–112wp_parse_args(), __(), esc_html(), esc_attr(), _e(), array_keys()
!isset($args) && !empty($args)103–114wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_attr(), array_keys()
!isset($args) && !empty($args)103–114wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), array_keys()
!isset($args) && empty($args) && !$i106–117wp_parse_args(), esc_attr(), _e(), esc_attr(), _e(), array_keys()
!isset($args) && empty($args) && !$i106–117wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), array_keys()
!isset($args) && !empty($args)106–113wp_parse_args(), __(), esc_html(), esc_attr(), checked(), _e(), array_keys()
52 further outcomes, up to 199 instructions
!isset($args) && empty($args)108–119wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), array_keys()
!isset($args) && empty($args) && !$i109–116wp_parse_args(), esc_attr(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)110–117wp_parse_args(), esc_attr(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)111–118wp_parse_args(), esc_attr(), _e(), esc_attr(), checked(), _e(), array_keys()
!isset($args) && empty($args)111–118wp_parse_args(), esc_attr(), _e(), esc_url(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i119–130wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_attr(), _e(), array_keys()
!isset($args) && !empty($args) && !$i119–130wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), array_keys()
!isset($args) && !empty($args)121–132wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), array_keys()
!isset($args) && !empty($args) && !$i122–129wp_parse_args(), __(), esc_html(), esc_attr(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)123–130wp_parse_args(), __(), esc_html(), esc_attr(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i124–135wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), _e(), array_keys()
!isset($args) && !empty($args)124–131wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_attr(), checked(), _e(), array_keys()
!isset($args) && !empty($args)124–131wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i126–133wp_parse_args(), esc_attr(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i127–134wp_parse_args(), esc_attr(), _e(), esc_attr(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i127–134wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)127–134wp_parse_args(), esc_attr(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)128–135wp_parse_args(), esc_attr(), _e(), esc_attr(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)128–135wp_parse_args(), esc_attr(), _e(), esc_url(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)129–136wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i137–148wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), _e(), array_keys()
!isset($args) && !empty($args) && !$i139–146wp_parse_args(), __(), esc_html(), esc_attr(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i140–147wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_attr(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i140–147wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)140–147wp_parse_args(), __(), esc_html(), esc_attr(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)141–148wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_attr(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)141–148wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)142–149wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i143–150wp_parse_args(), esc_attr(), _e(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i144–151wp_parse_args(), esc_attr(), _e(), esc_attr(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i144–151wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i145–152wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)145–152wp_parse_args(), esc_attr(), _e(), esc_attr(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)145–152wp_parse_args(), esc_attr(), _e(), esc_url(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)146–153wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i156–163wp_parse_args(), __(), esc_html(), esc_attr(), _e(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i157–164wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_attr(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i157–164wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i158–165wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)158–165wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_attr(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)158–165wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)159–166wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i161–168wp_parse_args(), esc_attr(), _e(), esc_attr(), _e(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i161–168wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && !$i162–169wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args)163–170wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i174–181wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_attr(), _e(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i174–181wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && !$i175–182wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args)176–183wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && empty($args) && $inputs && !$i179–186wp_parse_args(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), _e(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()
!isset($args) && !empty($args) && $inputs && !$i192–199wp_parse_args(), __(), esc_html(), esc_attr(), _e(), esc_url(), _e(), esc_attr(), _e(), checked(), _e(), checked(), _e(), checked(), _e(), array_keys()

This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev26272–19922
8.526272–19922
8.426272–199223 fewer instructions than PHP 8.3
8.326572–19922
8.226572–19922
8.126572–199229 fewer instructions than PHP 7.4
7.427475–20222

An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.

Uses · 8

Used by · 2

Source code

function wp_widget_rss_form( $args, $inputs = null ) {	$default_inputs = array(		'url'          => true,		'title'        => true,		'items'        => true,		'show_summary' => true,		'show_author'  => true,		'show_date'    => true,	);	$inputs         = wp_parse_args( $inputs, $default_inputs ); 	$args['title'] = isset( $args['title'] ) ? $args['title'] : '';	$args['url']   = isset( $args['url'] ) ? $args['url'] : '';	$args['items'] = isset( $args['items'] ) ? (int) $args['items'] : 0; 	if ( $args['items'] < 1 || 20 < $args['items'] ) {		$args['items'] = 10;	} 	$args['show_summary'] = isset( $args['show_summary'] ) ? (int) $args['show_summary'] : (int) $inputs['show_summary'];	$args['show_author']  = isset( $args['show_author'] ) ? (int) $args['show_author'] : (int) $inputs['show_author'];	$args['show_date']    = isset( $args['show_date'] ) ? (int) $args['show_date'] : (int) $inputs['show_date']; 	if ( ! empty( $args['error'] ) ) {		echo '<p class="widget-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $args['error'] ) . '</p>';	} 	$esc_number = esc_attr( $args['number'] );	if ( $inputs['url'] ) :		?>	<p><label for="rss-url-<?php echo $esc_number; ?>"><?php _e( 'Enter the RSS feed URL here:' ); ?></label>	<input class="widefat" id="rss-url-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][url]" type="text" value="<?php echo esc_url( $args['url'] ); ?>" /></p><?php endif; if ( $inputs['title'] ) : ?>	<p><label for="rss-title-<?php echo $esc_number; ?>"><?php _e( 'Give the feed a title (optional):' ); ?></label>	<input class="widefat" id="rss-title-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][title]" type="text" value="<?php echo esc_attr( $args['title'] ); ?>" /></p><?php endif; if ( $inputs['items'] ) : ?>	<p><label for="rss-items-<?php echo $esc_number; ?>"><?php _e( 'How many items would you like to display?' ); ?></label>	<select id="rss-items-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][items]">	<?php	for ( $i = 1; $i <= 20; ++$i ) {		echo "<option value='$i' " . selected( $args['items'], $i, false ) . ">$i</option>";	}	?>	</select></p><?php endif; if ( $inputs['show_summary'] || $inputs['show_author'] || $inputs['show_date'] ) : ?>	<p>	<?php if ( $inputs['show_summary'] ) : ?>		<input id="rss-show-summary-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][show_summary]" type="checkbox" value="1" <?php checked( $args['show_summary'] ); ?> />		<label for="rss-show-summary-<?php echo $esc_number; ?>"><?php _e( 'Display item content?' ); ?></label><br />	<?php endif; if ( $inputs['show_author'] ) : ?>		<input id="rss-show-author-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][show_author]" type="checkbox" value="1" <?php checked( $args['show_author'] ); ?> />		<label for="rss-show-author-<?php echo $esc_number; ?>"><?php _e( 'Display item author if available?' ); ?></label><br />	<?php endif; if ( $inputs['show_date'] ) : ?>		<input id="rss-show-date-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][show_date]" type="checkbox" value="1" <?php checked( $args['show_date'] ); ?> />		<label for="rss-show-date-<?php echo $esc_number; ?>"><?php _e( 'Display item date?' ); ?></label><br />	<?php endif; ?>	</p>	<?php	endif; // End of display options.foreach ( array_keys( $default_inputs ) as $input ) :	if ( 'hidden' === $inputs[ $input ] ) :		$id = str_replace( '_', '-', $input );		?><input type="hidden" id="rss-<?php echo esc_attr( $id ); ?>-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][<?php echo esc_attr( $input ); ?>]" value="<?php echo esc_attr( $args[ $input ] ); ?>" />		<?php	endif;	endforeach;}

Changelog

Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/widgets.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.