Ejemplo n.º 1
0
/**
 * Create the shortcode.
 *
 * @example [pissc post_type="page" post_parent_in=4 exclude_current_post=1]
 * @since 3.0
 */
function pis_shortcode($atts)
{
    extract(shortcode_atts(array('post_type' => 'post', 'posts_id' => '', 'author' => '', 'author_in' => '', 'cat' => '', 'tag' => '', 'post_parent_in' => '', 'post_format' => '', 'number' => get_option('posts_per_page'), 'orderby' => 'date', 'order' => 'DESC', 'offset_number' => '', 'post_status' => 'publish', 'post_meta_key' => '', 'post_meta_val' => '', 'search' => NULL, 'ignore_sticky' => false, 'relation' => '', 'taxonomy_aa' => '', 'field_aa' => 'slug', 'terms_aa' => '', 'operator_aa' => 'IN', 'relation_a' => '', 'taxonomy_ab' => '', 'field_ab' => 'slug', 'terms_ab' => '', 'operator_ab' => 'IN', 'taxonomy_ba' => '', 'field_ba' => 'slug', 'terms_ba' => '', 'operator_ba' => 'IN', 'relation_b' => '', 'taxonomy_bb' => '', 'field_bb' => 'slug', 'terms_bb' => '', 'operator_bb' => 'IN', 'date_year' => '', 'date_month' => '', 'date_week' => '', 'date_day' => '', 'date_hour' => '', 'date_minute' => '', 'date_second' => '', 'date_after_year' => '', 'date_after_month' => '', 'date_after_day' => '', 'date_before_year' => '', 'date_before_month' => '', 'date_before_day' => '', 'date_inclusive' => false, 'date_column' => '', 'author_not_in' => '', 'exclude_current_post' => false, 'post_not_in' => '', 'cat_not_in' => '', 'tag_not_in' => '', 'post_parent_not_in' => '', 'display_title' => true, 'link_on_title' => true, 'arrow' => false, 'display_image' => false, 'image_size' => 'thumbnail', 'image_align' => 'no_change', 'image_before_title' => false, 'image_link' => '', 'custom_image_url' => '', 'custom_img_no_thumb' => true, 'excerpt' => 'excerpt', 'exc_length' => 20, 'the_more' => __('Read more…', 'posts-in-sidebar'), 'exc_arrow' => false, 'display_author' => false, 'author_text' => __('By', 'posts-in-sidebar'), 'linkify_author' => false, 'display_date' => false, 'date_text' => __('Published on', 'posts-in-sidebar'), 'linkify_date' => false, 'comments' => false, 'comments_text' => __('Comments:', 'posts-in-sidebar'), 'utility_sep' => '|', 'utility_after_title' => false, 'categories' => false, 'categ_text' => __('Category:', 'posts-in-sidebar'), 'categ_sep' => ',', 'tags' => false, 'tags_text' => __('Tags:', 'posts-in-sidebar'), 'hashtag' => '#', 'tag_sep' => '', 'display_custom_tax' => false, 'term_hashtag' => '', 'term_sep' => ',', 'custom_field' => false, 'custom_field_txt' => '', 'meta' => '', 'custom_field_key' => false, 'custom_field_sep' => ':', 'archive_link' => false, 'link_to' => 'category', 'archive_text' => __('Display all posts', 'posts-in-sidebar'), 'nopost_text' => __('No posts yet.', 'posts-in-sidebar'), 'margin_unit' => 'px', 'intro_margin' => NULL, 'title_margin' => NULL, 'side_image_margin' => NULL, 'bottom_image_margin' => NULL, 'excerpt_margin' => NULL, 'utility_margin' => NULL, 'categories_margin' => NULL, 'tags_margin' => NULL, 'terms_margin' => NULL, 'custom_field_margin' => NULL, 'archive_margin' => NULL, 'noposts_margin' => NULL, 'custom_styles' => '', 'list_element' => 'ul', 'remove_bullets' => false, 'debug_query' => false, 'debug_params' => false, 'debug_query_number' => false), $atts));
    return do_shortcode(pis_get_posts_in_sidebar($atts));
}
Ejemplo n.º 2
0
/**
 * The main function to echo the output.
 *
 * @uses get_pis_posts_in_sidebar()
 * @since 3.0
 */
function pis_posts_in_sidebar($args)
{
    echo pis_get_posts_in_sidebar($args);
}