on for checked, selected, disabled and readonly. * * Compares the first two arguments and if identical marks as $type * * @since 2.8.0 * @access private * * @param mixed $helper One of the values to compare * @param mixed $current (true) The other value to compare if not just true * @param bool $echo Whether to echo or just return the string * @param string $type The type of checked|selected|disabled|readonly we are doing * @return string HTML attribute or empty string */ function __checked_selected_helper( $helper, $current, $echo, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore if ( (string) $helper === (string) $current ) { $result = " $type='$type'"; } else { $result = ''; } if ( $echo ) { echo $result; } return $result; } /** * Default settings for heartbeat * * Outputs the nonce used in the heartbeat XHR * * @since 3.6.0 * * @param array $settings * @return array Heartbeat settings. */ function wp_heartbeat_settings( $settings ) { if ( ! is_admin() ) { $settings['ajaxurl'] = admin_url( 'admin-ajax.php', 'relative' ); } if ( is_user_logged_in() ) { $settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' ); } return $settings; }