wp_sprintf example

if ( empty( $t['term_template'] ) ) {
            $t['term_template'] = $args['term_template'];
        }

        $terms = get_object_term_cache( $post->ID, $taxonomy );
        if ( false === $terms ) {
            $terms = wp_get_object_terms( $post->ID, $taxonomy$t['args'] );
        }
        $links = array();

        foreach ( $terms as $term ) {
            $links[] = wp_sprintf( $t['term_template']esc_attr( get_term_link( $term ) )$term->name );
        }
        if ( $links ) {
            $taxonomies[ $taxonomy ] = wp_sprintf( $t['template']$t['label']$links$terms );
        }
    }
    return $taxonomies;
}

/** * Retrieves all taxonomy names for the given post. * * @since 2.5.0 * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. * @return string[] An array of all taxonomy names for the given post. */

function rest_handle_multi_type_schema( $value$args$param = '' ) {
    $allowed_types = array( 'array', 'object', 'string', 'number', 'integer', 'boolean', 'null' );
    $invalid_types = array_diff( $args['type']$allowed_types );

    if ( $invalid_types ) {
        _doing_it_wrong(
            __FUNCTION__,
            /* translators: 1: Parameter, 2: List of allowed types. */
            wp_sprintf( __( 'The "type" schema keyword for %1$s can only contain the built-in types: %2$l.' )$param$allowed_types ),
            '5.5.0'
        );
    }

    $best_type = rest_get_best_type_for_value( $value$args['type'] );

    if ( ! $best_type ) {
        if ( ! $invalid_types ) {
            return '';
        }

        
if ( ! count( $group_data ) ) {
        return;
    }

    if ( ! empty( $group_data['shuffle'] ) ) {
        shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.     }

    switch ( $group_data['type'] ) {
        case 'list':
            array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits_data['profiles'] );
            echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
            break;
        case 'libraries':
            array_walk( $group_data['data'], '_wp_credits_build_object_link' );
            echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
            break;
        default:
            $compact = 'compact' === $group_data['type'];
            $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
            echo '<ul class="' . $classes . '" id="wp-people-group-' . $slug . '">' . "\n";
            foreach ( $group_data['data'] as $person_data ) {
                echo '<li class="wp-person" id="wp-person-' . esc_attr( $person_data[2] ) . '">' . "\n\t";
                
Home | Imprint | This part of the site doesn't use cookies.