- Using Heading Block
- Buttons
- Post Grid
- Content Timeline
- Social Share
- Google Map
- Add Testimonials
- Info Box
- Section
- Team
- Icon List
- Price List
- Post Masonry
- Post Carousel
- Importing Starter Templates With Spectra
- Post Timeline
- Call To Action
- Advanced Columns
- Troubleshooting: Missing Icons
- Filters/Actions For Post
- Blockquote
- Spectra Patterns
- Contact Form 7: Multiple Column Fields
- Contact Form 7: Checkbox / Radio / Acceptance Control
- Unable To Style Contact Form 7
- Marketing Button
- Tab Index For Multiple Gravity Forms
- Getting Started With Spectra
- Manually Install Spectra Via FTP
- Table Of Contents
- How-to Schema
- FAQ’s: Schema/Accordion
- Inline Notice
- WP – Search
- Exclude Heading From TOC
- Review Schema
- Lottie
- Taxonomy List
- Tabs Block
- Block Display Conditions
- Create Contact Forms
- Import Single Pages, Templates, & Block Patterns
- Enable/Disable Design Library Button
- Update Folder File Permissions
- Assets API For Third-Party Plugins
- Star Rating
- Masonry Image Gallery
- Wireframe Blocks
- Copy & Paste Style
- Coming Soon Mode
- Load Google Fonts Locally
- Container Flex Property
- Default Content Width
- Blocks Editor Spacing
- Heading Block
- Image Block
- Buttons Block
- Translate Everything WPML
- Container Block
- Collapse Panels
- Responsive Conditions
- Taxonomy Styling Options
- Block Presets
- Image Gallery
- Counter Block
- Modal Block
- Registration Form Block
- Dynamic Content Extension
- Slider Block
- Pagel Level Custom CSS
- Countdown Pro
- Slider Custom Navigation
- Instagram Feed
- Loop Builder
- Animations
- Login Form Block
- Site Visibility
- Global Block Style Extension
- Spectra Actions: Clear Cache
- Create Popups
- Quick Action Bar
- Custom Blocks
- Move Block Patterns
- Grid Builder
- Move Title Bar To Top
- Resolving Container Layout Conflicts
- Newsletter Forms
- Register High-Privileged Users
- User Roles Access To AI
- Database Update Instructions (Below 2.0.0)
- FAQ's: VIP Priority Support
- Whitelist Email Address
- Hide Core Blocks
- Regenerate Assets With Code
- Using ACF Repeater Field in Spectra
- Pixabay Image Search Feature
- Getting Started with Instagram
- How to Fix Stretched Spectra Images in WordPress 6.7
- How to Change Breakpoints in Spectra?
- Controlling Access to the Spectra Design Library Based on User Roles
- Advanced Loop Builder
- Multi-Column Form Block Using Utility Classes
- Why Am I Seeing Mixed Content or Non-HTTPS Errors?
- Preview Options (Desktop, Tablet & Mobile)
- Transparent / Sticky Header
- Change Site Logo
- Change Global Styles
- Disable Title on Posts & Pages
- Transparent / Sticky Header For Single Page / Post
- Change Header & Footer Patterns
- Custom / Google Fonts
- Reset Global Default Styling
- Manually Install Spectra One Via FTP
- Enable / Disable Header & Footer On Specific Pages / Posts
Filters/Actions For Post
Actions/Filters 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.
$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.$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.- POST_BLOCK_TYPE : This is the type of Post Block you are using – grid/masonry/carousel
uagb_post_query_args_{POST_BLOCK_TYPE}
This filter modifies the Query Arguments for Post Grid, Post Masonry, Post Carousel, Post Timeline, etc.
function filter_post_query( $query_args, $attributes) {
// Modify $query_args values.
// Ex.
$query_args['ignore_sticky_posts'] = 0;
return $query_args;
}
add_filter( 'uagb_post_query_args_grid', 'filter_post_query', 10, 2 );
uagb_enable_post_class
This filter enables the `post_class()` compatibility to the respective Post Grid, Masonry, Carousel block.
add_filter( 'uagb_enable_post_class', '__return_true' );
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_excerpt_{POST_BLOCK_TYPE}
This filter is used to allow customization in post excerpt (i.e. to display video/images/links) for the Post Grid, Post Masonry, Post Carousel, Post Timeline, etc. Below is the example for “Post Grid”:
add_filter('uagb_single_post_excerpt_grid', function($excerpt, $id, $attr) { return custom_post_content(30); },10, 3 );
function custom_post_content($limit) {
global $post;
$content = explode(' ', the_content(), $limit);
if (count($content)>=$limit) {
array_pop($content);
$content = implode(" ",$content);
} else {
$content = implode(" ",$content);
}
$content = preg_replace('/\\[.+\\]/','', $content);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
return $content;
}
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 );
We don't respond to the article feedback, we use it to improve our support content.