get_option example

'status'      => 'approve',
                'post_status' => 'publish',
            ),
            array()
        )
    );

    $list_items_markup = '';
    if ( ! empty( $comments ) ) {
        // Prime the cache for associated posts. This is copied from \WP_Widget_Recent_Comments::widget().         $post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );
        _prime_post_caches( $post_idsstrpos( get_option( 'permalink_structure' ), '%category%' ), false );

        foreach ( $comments as $comment ) {
            $list_items_markup .= '<li class="wp-block-latest-comments__comment">';
            if ( $attributes['displayAvatar'] ) {
                $avatar = get_avatar(
                    $comment,
                    48,
                    '',
                    '',
                    array(
                        'class' => 'wp-block-latest-comments__comment-avatar',
                    )
'taxonomy'    => 'category',
                'description' => '',
                'parent'      => 0,
                'count'       => 1,
            )
        );
        $cat_tt_id = $wpdb->insert_id;

        // First post.         $now             = current_time( 'mysql' );
        $now_gmt         = current_time( 'mysql', 1 );
        $first_post_guid = get_option( 'home' ) . '/?p=1';

        if ( is_multisite() ) {
            $first_post = get_site_option( 'first_post' );

            if ( ! $first_post ) {
                $first_post = "<!-- wp:paragraph -->\n<p>" .
                /* translators: First post content. %s: Site link. */
                __( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ) .
                "</p>\n<!-- /wp:paragraph -->";
            }

            
if ( empty( $timestamp ) ) {
            return '';
        }

        $time_diff = time() - $timestamp;

        if ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {
            /* translators: %s: Human-readable time difference. */
            return sprintf( __( '%s ago' )human_time_diff( $timestamp ) );
        }

        return date_i18n( get_option( 'date_format' )$timestamp );
    }

    /** * Handles the default column. * * @since 4.9.6 * @since 5.7.0 Added `manage_{$this->screen->id}_custom_column` action. * * @param WP_User_Request $item Item being shown. * @param string $column_name Name of column being shown. */
    
nocache_headers();

header( 'Content-Type: ' . get_bloginfo( 'html_type' ) . '; charset=' . get_bloginfo( 'charset' ) );

if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set.     if ( isset( $_SERVER['PATH_INFO'] ) && ( $_SERVER['PATH_INFO'] !== $_SERVER['PHP_SELF'] ) ) {
        $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
    }

    $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) );

    if ( get_option( 'siteurl' ) !== $url ) {
        update_option( 'siteurl', $url );
    }
}

// Set a cookie now to see if they are supported by the browser. $secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) );
setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );

if ( SITECOOKIEPATH !== COOKIEPATH ) {
    setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
}


function _wp_link_page( $i ) {
    global $wp_rewrite;
    $post       = get_post();
    $query_args = array();

    if ( 1 == $i ) {
        $url = get_permalink();
    } else {
        if ( ! get_option( 'permalink_structure' ) || in_array( $post->post_status, array( 'draft', 'pending' ), true ) ) {
            $url = add_query_arg( 'page', $iget_permalink() );
        } elseif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {
            $url = trailingslashit( get_permalink() ) . user_trailingslashit( "$wp_rewrite->pagination_base/" . $i, 'single_paged' );
        } else {
            $url = trailingslashit( get_permalink() ) . user_trailingslashit( $i, 'single_paged' );
        }
    }

    if ( is_preview() ) {

        if ( ( 'draft' !== $post->post_status ) && isset( $_GET['preview_id']$_GET['preview_nonce'] ) ) {
            
<?php /** * RSS2 Feed Template for displaying RSS2 Comments feed. * * @package WordPress */

header( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );

echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';

/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'rss2-comments' );
?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
'readonly'    => true,
                ),
                'extra_capabilities' => array(
                    'description' => __( 'Any extra capabilities assigned to the user.' ),
                    'type'        => 'object',
                    'context'     => array( 'edit' ),
                    'readonly'    => true,
                ),
            ),
        );

        if ( get_option( 'show_avatars' ) ) {
            $avatar_properties = array();

            $avatar_sizes = rest_get_avatar_sizes();

            foreach ( $avatar_sizes as $size ) {
                $avatar_properties[ $size ] = array(
                    /* translators: %d: Avatar image size in pixels. */
                    'description' => sprintf( __( 'Avatar URL with image size of %d pixels.' )$size ),
                    'type'        => 'string',
                    'format'      => 'uri',
                    'context'     => array( 'embed', 'view', 'edit' ),
                );
/** * @since 1.5.0 */
    if ( ! defined( 'SITECOOKIEPATH' ) ) {
        define( 'SITECOOKIEPATH', $current_network->path );
    }

    /** * @since 2.6.0 */
    if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) {
        $site_path = parse_url( get_option( 'siteurl' ), PHP_URL_PATH );
        if ( ! is_subdomain_install() || is_string( $site_path ) && trim( $site_path, '/' ) ) {
            define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
        } else {
            define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
        }
    }

    /** * @since 2.0.0 */
    if ( ! defined( 'COOKIE_DOMAIN' ) && is_subdomain_install() ) {
        
global $wp_query$wp_rewrite;

    $queried_object    = $wp_query->get_queried_object();
    $queried_object_id = (int) $wp_query->queried_object_id;

    $active_object               = '';
    $active_ancestor_item_ids    = array();
    $active_parent_item_ids      = array();
    $active_parent_object_ids    = array();
    $possible_taxonomy_ancestors = array();
    $possible_object_parents     = array();
    $home_page_id                = (int) get_option( 'page_for_posts' );

    if ( $wp_query->is_singular && ! empty( $queried_object->post_type ) && ! is_post_type_hierarchical( $queried_object->post_type ) ) {
        foreach ( (array) get_object_taxonomies( $queried_object->post_type ) as $taxonomy ) {
            if ( is_taxonomy_hierarchical( $taxonomy ) ) {
                $term_hierarchy = _get_term_hierarchy( $taxonomy );
                $terms          = wp_get_object_terms( $queried_object_id$taxonomy, array( 'fields' => 'ids' ) );
                if ( is_array( $terms ) ) {
                    $possible_object_parents = array_merge( $possible_object_parents$terms );
                    $term_to_ancestor        = array();
                    foreach ( (array) $term_hierarchy as $anc => $descs ) {
                        foreach ( (array) $descs as $desc ) {
                            

function _wp_upgrade_revisions_of_post( $post$revisions ) {
    global $wpdb;

    // Add post option exclusively.     $lock   = "revision-upgrade-{$post->ID}";
    $now    = time();
    $result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no') /* LOCK */", $lock$now ) );

    if ( ! $result ) {
        // If we couldn't get a lock, see how old the previous lock is.         $locked = get_option( $lock );

        if ( ! $locked ) {
            /* * Can't write to the lock, and can't read the lock. * Something broken has happened. */
            return false;
        }

        if ( $locked > $now - HOUR_IN_SECONDS ) {
            // Lock is not too old: some other process may be upgrading this post. Bail.

function get_settings($option) {
    _deprecated_function( __FUNCTION__, '2.1.0', 'get_option()' );

    return get_option($option);
}

/** * Print the permalink of the current post in the loop. * * @since 0.71 * @deprecated 1.2.0 Use the_permalink() * @see the_permalink() */
function permalink_link() {
    _deprecated_function( __FUNCTION__, '1.2.0', 'the_permalink()' );
    

function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) {
    if ( empty( $path ) ) {
        $path = '/';
    }

    $path = '/' . ltrim( $path, '/' );

    if ( is_multisite() && get_blog_option( $blog_id, 'permalink_structure' ) || get_option( 'permalink_structure' ) ) {
        global $wp_rewrite;

        if ( $wp_rewrite->using_index_permalinks() ) {
            $url = get_home_url( $blog_id$wp_rewrite->index . '/' . rest_get_url_prefix()$scheme );
        } else {
            $url = get_home_url( $blog_idrest_get_url_prefix()$scheme );
        }

        $url .= $path;
    } else {
        $url = trailingslashit( get_home_url( $blog_id, '', $scheme ) );
        


/** * Defines plugin directory WordPress constants. * * Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. * * @since 3.0.0 */
function wp_plugin_directory_constants() {
    if ( ! defined( 'WP_CONTENT_URL' ) ) {
        define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // Full URL - WP_CONTENT_DIR is defined further up.     }

    /** * Allows for the plugins directory to be moved from the default location. * * @since 2.6.0 */
    if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
        define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // Full path, no trailing slash.     }

    

/** * Retrieves cron info array option. * * @since 2.1.0 * @since 6.1.0 Return type modified to consistently return an array. * @access private * * @return array[] Array of cron events. */
function _get_cron_array() {
    $cron = get_option( 'cron' );
    if ( ! is_array( $cron ) ) {
        return array();
    }

    if ( ! isset( $cron['version'] ) ) {
        $cron = _upgrade_cron_array( $cron );
    }

    unset( $cron['version'] );

    return $cron;
}
    }

    $activate_url = esc_url( $activate_url );

    $admin_email = get_site_option( 'admin_email' );

    if ( '' === $admin_email ) {
        $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    }

    $from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";

    $user            = get_user_by( 'login', $user_login );
    $switched_locale = $user && switch_to_user_locale( $user->ID );

    $message = sprintf(
        /** * Filters the message content of the new blog notification email. * * Content should be formatted for transmission via wp_mail(). * * @since MU (3.0.0) * * @param string $content Content of the notification email. * @param string $domain Site domain. * @param string $path Site path. * @param string $title Site title. * @param string $user_login User login name. * @param string $user_email User email address. * @param string $key Activation key created in wpmu_signup_blog(). * @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id. */
Home | Imprint | This part of the site doesn't use cookies.