'', 'count' => 1, 'offset' => 0, 'ids' => null, 'category' => null, 'tag' => null, 'time_frame' => null, 'orderby' => 'date', 'order' => 'DESC', 'template' => 'list', 'image_size' => 'pk-thumbnail', 'exclude_posts' => $powerkit_inline_posts, ), $atts ) ); $posts = powerkit_get_inline_posts( $atts ); $columns = 1; $template = $atts['template']; // Check grid template. switch ( $atts['template'] ) { case 'grid-2': $template = 'grid'; $columns = 2; break; case 'grid-3': $template = 'grid'; $columns = 3; break; case 'grid-4': $template = 'grid'; $columns = 4; break; } if ( $posts ) { ?>
< class="pk-inline-posts-title pk-title pk-font-block"> >
ID; // Output template. powerkit_inline_posts_template_handler( $atts['template'], $posts, $atts ); } ?>
'inline_posts', 'title' => esc_html__( 'Inline Posts', 'powerkit' ), 'priority' => 200, 'base' => 'powerkit_posts', 'autoregister' => false, 'fields' => array( array( 'type' => 'input', 'name' => 'title', 'label' => esc_html__( 'Title', 'powerkit' ), 'default' => '', ), array( 'type' => 'input', 'name' => 'count', 'label' => esc_html__( 'Count', 'powerkit' ), 'default' => 1, ), array( 'type' => 'input', 'name' => 'offset', 'label' => esc_html__( 'Offset', 'powerkit' ), 'default' => 0, ), array( 'type' => 'input', 'name' => 'image_size', 'label' => esc_html__( 'Image size', 'powerkit' ), 'default' => 'pk-thumbnail', ), array( 'type' => 'input', 'name' => 'category', 'label' => esc_html__( 'Filter by categories', 'powerkit' ), 'desc' => esc_html__( 'Add comma-separated list of category slugs. For example: «travel, lifestyle, food». Leave empty for all categories.', 'powerkit' ), 'default' => '', ), array( 'type' => 'input', 'name' => 'tag', 'label' => esc_html__( 'Filter by tags', 'powerkit' ), 'desc' => esc_html__( 'Add comma-separated list of tag slugs. For example: «worth-reading, top-5, playlists». Leave empty for all tags.', 'powerkit' ), 'default' => '', ), array( 'type' => 'input', 'name' => 'ids', 'label' => esc_html__( 'Filter by posts', 'powerkit' ), 'desc' => esc_html__( 'Add comma-separated list of post IDs. For example: 12, 34, 145. Leave empty for all posts.', 'powerkit' ), 'default' => '', ), ), ); // Add fields order and time frame. if ( powerkit_post_views_enabled() ) { $shortcode_map['fields'][] = array( 'type' => 'radio', 'name' => 'orderby', 'label' => esc_html__( 'Order posts by', 'powerkit' ), 'style' => 'vertical', 'default' => 'date', 'options' => array( 'date' => esc_html__( 'Date', 'powerkit' ), 'post_views' => esc_html__( 'Views', 'powerkit' ), ), ); $shortcode_map['fields'][] = array( 'type' => 'radio', 'name' => 'order', 'label' => esc_html__( 'Order', 'powerkit' ), 'style' => 'vertical', 'default' => 'DESC', 'options' => array( 'DESC' => esc_html__( 'DESC', 'powerkit' ), 'ASC' => esc_html__( 'ASC', 'powerkit' ), ), ); $shortcode_map['fields'][] = array( 'type' => 'input', 'name' => 'time_frame', 'label' => esc_html__( 'Filter by time frame', 'powerkit' ), 'desc' => esc_html__( 'Work only if Order by Views', 'powerkit' ) . '
' . esc_html__( 'Add period of posts in English. For example: «2 months», «14 days» or even «1 year»', 'powerkit' ), 'default' => '', ); } // Add field template. $templates = apply_filters( 'powerkit_inline_posts_templates', array() ); if ( count( (array) $templates ) > 1 ) { $options = array(); foreach ( $templates as $key => $item ) { if ( isset( $item['name'] ) ) { $options[ $key ] = $item['name']; } } $shortcode_map['fields'][] = array( 'type' => 'select', 'name' => 'template', 'label' => esc_html__( 'Template', 'powerkit' ), 'default' => 'list', 'options' => $options, ); } powerkit_basic_shortcodes_register( $shortcode_map ); }); endif;