get_post_format_link example

$found_ids = array();
        foreach ( $format_slugs as $index => $format_slug ) {
            if ( ! empty( $query_args['search'] ) ) {
                $format_string       = get_post_format_string( $format_slug );
                $format_slug_match   = stripos( $format_slug$query_args['search'] ) !== false;
                $format_string_match = stripos( $format_string$query_args['search'] ) !== false;
                if ( ! $format_slug_match && ! $format_string_match ) {
                    continue;
                }
            }

            $format_link = get_post_format_link( $format_slug );
            if ( $format_link ) {
                $found_ids[] = $format_slug;
            }
        }

        $page     = (int) $request['page'];
        $per_page = (int) $request['per_page'];

        return array(
            self::RESULT_IDS   => array_slice( $found_ids( $page - 1 ) * $per_page$per_page ),
            self::RESULT_TOTAL => count( $found_ids ),
        );
Home | Imprint | This part of the site doesn't use cookies.