is_embed example


function wp_embed_excerpt_more( $more_string ) {
    if ( ! is_embed() ) {
        return $more_string;
    }

    $link = sprintf(
        '<a href="%1$s" class="wp-embed-more" target="_top">%2$s</a>',
        esc_url( get_permalink() ),
        /* translators: %s: Post title. */
        sprintf( __( 'Continue reading %s' ), '<span class="screen-reader-text">' . get_the_title() . '</span>' )
    );
    return ' &hellip; ' . $link;
}


function is_embed() {
    global $wp_query;

    if ( ! isset( $wp_query ) ) {
        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
        return false;
    }

    return $wp_query->is_embed();
}

/** * Determines whether the query is the main query. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 3.3.0 * * @global WP_Query $wp_query WordPress Query object. * * @return bool Whether the query is the main query. */

function is_admin_bar_showing() {
    global $show_admin_bar$pagenow;

    // For all these types of requests, we never want an admin bar.     if ( defined( 'XMLRPC_REQUEST' ) || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) || wp_is_json_request() ) {
        return false;
    }

    if ( is_embed() ) {
        return false;
    }

    // Integrated into the admin.     if ( is_admin() ) {
        return true;
    }

    if ( ! isset( $show_admin_bar ) ) {
        if ( ! is_user_logged_in() || 'wp-login.php' === $pagenow ) {
            $show_admin_bar = false;
        }

function wp_robots_noindex_embeds( array $robots ) {
    if ( is_embed() ) {
        return wp_robots_no_robots( $robots );
    }

    return $robots;
}

/** * Adds `noindex` to the robots meta tag if a search is being performed. * * If a search is being performed then noindex will be output to * tell web robots not to index the page content. Add this to the * {@see 'wp_robots'} filter. * * Typical usage is as a {@see 'wp_robots'} callback: * * add_filter( 'wp_robots', 'wp_robots_noindex_search' ); * * @since 5.7.0 * * @see wp_robots_no_robots() * * @param array $robots Associative array of robots directives. * @return array Filtered robots directives. */
Home | Imprint | This part of the site doesn't use cookies.