Filters/Actions for Posts Widget

#Actions

Actions available for Posts Widget are listed below.
The parameters used in the below actions/filters are one of the below-listed options. The detailed description of these parameters is as specified below.

  1. $settings : This is the entire setting array for the particular dragged dropped Post Widget. One can add conditional logic as per the selected options in the settings.
  2. $post_id : This is the single post ID in the loop. This is useful when one wants to fetch post specific data and display it.

uael_posts_before_outer_wrap

Fires at the beginning of the post outer wrap

function summary_wrap_before( $settings ) {
    echo '<div> I am at the beginning of the post outer wrap. </div>'; 
} 
add_action( 'uael_posts_before_outer_wrap', 'summary_wrap_before', 10, 1 );

uael_posts_after_outer_wrap

Fires at the end of the post outer wrap

function summary_wrap_after( $settings ) {
    echo '<div> I am at the end of the post outer wrap. </div>'; 
} 
add_action( 'uael_posts_after_outer_wrap', 'summary_wrap_after', 10, 1 );

uael_posts_before_wrap

Fires at the beginning of the post wrap

function post_wrap_before( $settings ) {
    echo '<div> I am at the beginning of the post wrap. </div>'; 
} 
add_action( 'uael_posts_before_wrap', 'post_wrap_before', 10, 1 );

uael_posts_after_wrap

Fires at the end of the post wrap

function post_wrap_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post wrap. </div>'; 
} 
add_action( 'uael_posts_after_wrap', 'post_wrap_after', 10, 2 );

uael_single_post_before_wrap

Fires at the beginning of the single post wrap

function single_post_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the single post wrap. </div>'; 
} 
add_action( 'uael_single_post_before_wrap', 'single_post_before', 10, 2 );

uael_single_post_after_wrap

Fires at the end of the single post wrap

function single_post_after( $post_id, $settings ) {
    echo '<div> I am at the end of the single post wrap. </div>'; 
} 
add_action( 'uael_single_post_after_wrap', 'single_post_after', 10, 2 );

uael_single_post_before_inner_wrap

Fires at the beginning of the single post inner wrap

function single_post_inner_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the single post inner wrap. </div>'; 
} 
add_action( 'uael_single_post_before_inner_wrap', 'single_post_inner_before', 10, 2 );

uael_single_post_after_inner_wrap

Fires at the end of the single post inner wrap

function single_post_inner_after( $post_id, $settings ) {
    echo '<div> I am at the end of the single post inner wrap. </div>'; 
} 
add_action( 'uael_single_post_after_inner_wrap', 'single_post_inner_after', 10, 2 );

uael_single_post_before_content_wrap

Fires at the beginning of the single post content wrap

function single_post_content_wrap_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the single post content wrap. </div>'; 
} 
add_action( 'uael_single_post_before_content_wrap', 'single_post_content_wrap_before', 10, 2 );

uael_single_post_after_content_wrap

Fires at the end of the single post content wrap

function single_post_content_wrap_after( $post_id, $settings ) {
    echo '<div> I am at the end of the single post content wrap. </div>'; 
} 
add_action( 'uael_single_post_after_content_wrap', 'single_post_content_wrap_after', 10, 2 );

uael_single_post_before_thumbnail

Fires at the beginning of the post thumbnail

function single_post_thumb_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post thumbnail. </div>'; 
} 
add_action( 'uael_single_post_before_thumbnail', 'single_post_thumb_before', 10, 2 );

uael_single_post_after_thumbnail

Fires at the end of the post thumbnail

function single_post_thumb_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post thumbnail. </div>'; 
} 
add_action( 'uael_single_post_after_thumbnail', 'single_post_thumb_after', 10, 2 );

uael_single_post_before_meta

Fires at the beginning of the post meta

function single_post_meta_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post meta. </div>'; 
} 
add_action( 'uael_single_post_before_meta', 'single_post_meta_before', 10, 2 );

uael_single_post_after_meta

Fires at the end of the post meta

function single_post_meta_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post meta. </div>'; 
} 
add_action( 'uael_single_post_after_meta', 'single_post_meta_after', 10, 2 );

uael_single_post_before_terms

Fires at the beginning of the post terms

function single_post_terms_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post terms. </div>'; 
} 
add_action( 'uael_single_post_before_terms', 'single_post_terms_before', 10, 2 );

uael_single_post_after_terms

Fires at the end of the post terms

function single_post_terms_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post terms. </div>'; 
} 
add_action( 'uael_single_post_after_terms', 'single_post_terms_after', 10, 2 );

uael_single_post_before_comments

Fires at the beginning of the post comments

function single_post_comment_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post comments. </div>'; 
} 
add_action( 'uael_single_post_before_comments', 'single_post_comment_before', 10, 2 );

uael_single_post_after_comments

Fires at the end of the post comments

function single_post_comment_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post comments. </div>'; 
} 
add_action( 'uael_single_post_after_comments', 'single_post_comment_after', 10, 2 );

uael_single_post_before_date

Fires at the beginning of the post date

function single_post_date_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post date. </div>'; 
} 
add_action( 'uael_single_post_before_date', 'single_post_date_before', 10, 2 );

uael_single_post_after_date

Fires at the end of the post date

function single_post_date_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post date. </div>'; 
} 
add_action( 'uael_single_post_after_date', 'single_post_date_after', 10, 2 );

uael_single_post_before_author

Fires at the beginning of the post author

function single_post_author_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post author. </div>'; 
} 
add_action( 'uael_single_post_before_author', 'single_post_author_before', 10, 2 );

uael_single_post_after_author

Fires at the end of the post author

function single_post_author_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post author. </div>'; 
} 
add_action( 'uael_single_post_after_author', 'single_post_author_after', 10, 2 );

uael_single_post_before_title

Fires at the beginning of the post title

function title_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post title. </div>'; 
} 
add_action( 'uael_single_post_before_title', 'title_before', 10, 2 );

uael_single_post_after_title

Fires at the end of the post title

function title_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post title. </div>'; 
} 
add_action( 'uael_single_post_after_title', 'title_after', 10, 2 );

uael_single_post_before_excerpt

Fires at the beginning of the post excerpt

function excerpt_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post excerpt. </div>'; 
} 
add_action( 'uael_single_post_before_excerpt', 'excerpt_before', 10, 2 );

uael_single_post_after_excerpt

Fires at the end of the post excerpt

function excerpt_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post excerpt. </div>'; 
} 
add_action( 'uael_single_post_after_excerpt', 'excerpt_after', 10, 2 );

uael_single_post_before_cta

Fires at the beginning of the post cta

function cta_before( $post_id, $settings ) {
    echo '<div> I am at the beginning of the post cta. </div>'; 
} 
add_action( 'uael_single_post_before_cta', 'cta_before', 10, 2 );

uael_single_post_after_cta

Fires at the end of the post cta

function cta_after( $post_id, $settings ) {
    echo '<div> I am at the end of the post cta. </div>'; 
} 
add_action( 'uael_single_post_after_cta', 'cta_after', 10, 2 );

#Filters

Filters available for Posts Widget are listed below.
The parameters used in the below filters are one of the below-listed options. The detailed description of these parameters is as specified below.

  1. $settings : This is the entire setting array for the particular dragged dropped Post Widget. One can add conditional logic as per the selected options in the settings.
  2. $post_id : This is the single post ID in the loop. This is useful when one wants to fetch post specific data and display it.
  3. $query : The WP_Query object.
  4. $classes : The array of classes.
  5. $date_format : This is the date format in terms of “F j, Y”

Helps modify Query Arguments.

add_filter( 'uael_posts_query_args', function( $query, $settings ) {
    // Modify the query here
    return $query;
}, 10, 2 );

Helps to add extra classes to Post Wrapper.

add_filter( 'uael_wrapper_classes', function( $classes ) {
    // Modify the classes array here.
    array_push( $classes, 'my-new-class' );
    return $classes;
} );

Helps to add extra classes to Post outer Wrapper.

add_filter( 'uael_outer_wrapper_classes', function( $classes ) {
    // Modify the classes array here.
    array_push( $classes, 'my-new-class123' );
    return $classes;
} );

Helps modify Post Permalink.

add_filter( 'uael_single_post_link', function( $link, $post_id, $settings ) {
    // Modify the link here
    $link .= '&utm_campaign=post_grid';
    return $link;
}, 10, 3 );

Helps modify Post Date Format.

add_filter( 'uael_post_the_date_format', function( $date, $post_id, $date_format ) {
    // Modify the date here
    return $date;
}, 10, 3 );

Helps modify Post Meta Sequence.

add_filter( 'uael_post_meta_sequence', function( $sequence ) {
    // Modify the date here
    // The below array is the actual sequence, you can swap the elements to have the desired sequence for meta
    return array( 'author', 'date', 'comments', 'cat', 'tag' );
});

Helps Linking/Unlinking the taxonomy badge.

add_filter( 'uael_link_taxomony_badge', function( $value ) {
    // Set the value to "yes" to link the Taxonomy badge.
    // Set the value to "no" to unlink the Taxonomy badge.
    $value = 'yes';
    return $value;
} );

Helps modify Filterable Tabs.

add_filter( 'uael_posts_filterable_tabs', function( $filters, $settings ) {
    // Modify the array here.
    return $filters;
}, 10, 2 );

Helps modify the terms of Taxonomy Badge.

add_filter( 'uael_posts_tax_filter', function( $terms ) {
// Modify the array here.
return $terms;
}, 10, 2 );

Helps modify the post date in the event skin.

add_filter( 'uael_post_event_date', function( $date, $post_id, $date_format ) {
    // Modify the date here
    return $date;
}, 10, 3 );
Not the solution you are looking for? Check other articles, or open a support ticket.