[Support request] List Of Shortcode Parametere?

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support List Of Shortcode Parametere?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31152
    joe
    Participant

    Hello, I tried searching for lists of available param for the shortcode but I can’t seem to find it in the documentations.

    [wp_show_posts id=”18363″ settings=”orderby=start_date&order=DEC”] is all I could find here in the forum. What are the other available?

    #31181
    elvin
    Moderator

    Hi Joe,

    We don’t have a list but these are basically wp_query parameters from WordPress codex.
    https://developer.wordpress.org/reference/classes/wp_query/

    It’s basically separated with &.

    But if you want to do a more detailed way of doing the parameters, use wp_show_posts_shortcode_args filter.

    Example: adding parameter for meta_query https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters

    add_filter( 'wp_show_posts_shortcode_args', function( $args, $settings ) {
        if ( 123 === $settings['list_id'] ) {
            $args['meta_query'] => array(
                array(
                    'key' => 'post_views_count',
                    'orderby' => 'meta_value_num',
                    'order' => 'DESC',
                )
            );
        }
    
        return $args;
    } );

    Where 123 is your target WPSP id.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.