Filters/Actions for Post

Actions available for Posts Block 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. $attributes : This is the entire setting array for the particular dragged dropped Post Block. 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. POST_BLOCK_TYPE : This is the type of Post Block you are using – grid/masonry/carousel

uagb_post_before_article_{POST_BLOCK_TYPE}

Fires at the beginning of the single post article tag

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

uagb_post_after_article_{POST_BLOCK_TYPE}

Fires at the end of the single post article tag

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

uagb_post_before_inner_wrap_{POST_BLOCK_TYPE}

Fires at the beginning of the single post inner wrap

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

uagb_post_after_inner_wrap_{POST_BLOCK_TYPE}

Fires at the end of the single post inner wrap

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

uagb_single_post_before_featured_image_{POST_BLOCK_TYPE}

Fires at the beginning of the single post featured image

function single_post_featured_image_before( $post_id, $attributes ) {
    echo '<div> I am at the beginning of the single post featured image. </div>'; 
} 
add_action( 'uagb_single_post_before_featured_image_grid', 'single_post_featured_image_before', 10, 2 );

uagb_single_post_after_featured_image_{POST_BLOCK_TYPE}

Fires at the end of the single post featured image

function single_post_featured_image_after( $post_id, $attributes ) {
    echo '<div> I am at the end of the single post featured image. </div>'; 
} 
add_action( 'uagb_single_post_after_featured_image_grid', 'single_post_featured_image_after', 10, 2 );

uagb_single_post_before_title_{POST_BLOCK_TYPE}

Fires at the beginning of the single post title

function single_post_title_before( $post_id, $attributes ) {
    echo '<div> I am at the beginning of the single post title. </div>'; 
} 
add_action( 'uagb_single_post_before_title_grid', 'single_post_title_before', 10, 2 );

uagb_single_post_after_title_{POST_BLOCK_TYPE}

Fires at the end of the single post title

function single_post_title_after( $post_id, $attributes ) {
    echo '<div> I am at the end of the single post title. </div>'; 
} 
add_action( 'uagb_single_post_after_title_grid', 'single_post_title_after', 10, 2 );

uagb_single_post_before_meta_{POST_BLOCK_TYPE}

Fires at the beginning of the single post meta

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

uagb_single_post_after_meta_{POST_BLOCK_TYPE}

Fires at the end of the single post meta

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

uagb_single_post_before_excerpt_{POST_BLOCK_TYPE}

Fires at the beginning of the single post excerpt

function single_post_excerpt_before( $post_id, $attributes ) {
    echo '<div> I am at the beginning of the single post excerpt. </div>'; 
} 
add_action( 'uagb_single_post_before_excerpt_grid', 'single_post_excerpt_before', 10, 2 );

uagb_single_post_after_excerpt_{POST_BLOCK_TYPE}

Fires at the end of the single post excerpt

function single_post_excerpt_after( $post_id, $attributes ) {
    echo '<div> I am at the end of the single post excerpt. </div>'; 
} 
add_action( 'uagb_single_post_after_excerpt_grid', 'single_post_excerpt_after', 10, 2 );

uagb_single_post_before_cta_{POST_BLOCK_TYPE}

Fires at the beginning of the single post cta

function single_post_cta_before( $post_id, $attributes ) {
    echo '<div> I am at the beginning of the single post cta. </div>'; 
} 
add_action( 'uagb_single_post_before_cta_grid', 'single_post_cta_before', 10, 2 );

uagb_single_post_after_cta_{POST_BLOCK_TYPE}

Fires at the end of the single post cta

function single_post_cta_after( $post_id, $attributes ) {
    echo '<div> I am at the end of the single post cta. </div>'; 
} 
add_action( 'uagb_single_post_after_cta_grid', 'single_post_cta_after', 10, 2 );