Make sure you’ve read the shortcode API. A shortcode must be a callback (i.e. a function), not a value. And add_shortcode
only works for the shortcode name, not an attribute:
dynamichidden
is the name of the shortcode, and CF7_custom_prod_code
is an attribute. You won’t be able to hook into it using add_shortcode( 'CF7_custom_prod_code' )
. You can however use the do_shortcode_tag
filter to modify the output of any shortcode handler:
add_filter( 'do_shortcode_tag', function ( $html, $name, $attr ) {
if ( $name === 'dynamichidden' && in_array( 'CF7_custom_prod_code', $attr ) ) {
// Do something with $html
}
return $html;
}, 10, 3 );
Related Posts:
- Post preview mechanism architecture
- Post featured image column on admin post list page
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- Counting words in a post
- the_post_navigation seems to ignore same category filter
- How to programmatically create posts in wordpress?
- How to avoid duplicate posts on front page?
- is there a better way of combining this?
- How to output comments number of a post per day?
- Remove some articles from the list in WPAdmin for a user
- Pagination – Posting First Page Content
- get_permalink executes link without https
- Auto Refresh Post List after X seconds
- How to show featured image in custom post type dashboard post page
- Notification to Admin or Author upon new post [duplicate]
- Displaying a widget only on long posts (over X characters)
- Remove permalink from images when inserting into post
- How to create a load more post entries like Twitter?
- WordPress blog post cloned and stolen?
- What is the Better way to manage posts in WordPress?
- Is there a way to apply WordPress categories at the block level?
- Featured Image uploaded, attached and set but only appearing in the media library
- Insert woocommerce products programmatically with featured image and gallery
- wp-cli post create & media import issues
- Getting the current author (it has changed) of a post, not the original author
- Post body text occupying featured image space before it loads
- Hightlight unread posts or new posts since last login
- User levels and post visibility
- Editing 375 posts simultaneously? Maybe from the database?
- Why does WP_Post not contain its permalink?
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- Remove Featured Image & All Media Uploaded to the Post
- How show categories in admin and get that selected to show posts in index
- Transition from Draft to Scheduled Post with wp_update_post
- Display related post by tag name of current post
- Get posts with multiple categories
- Do not show children of a category
- Tell WP to use a specific template file in posts
- Create a list of posts with topic headdings
- Custom Permalink Structure for Pages & Posts
- Getting a “404 Not Found” error when “Preview Changes” is clicked
- Display a list of users who have viewed the post you are viewing
- wp_update_post creating revisions instead of updating the post
- Where exactly should I hook in order to change the post’s ID before insertion in the database?
- Images showing up in Post Editor, but not in Published Post
- Display selected categories onto post page
- WordPress pagination and Post Navigation not working on home page
- Would a “hub” page work better as a page or a post?
- Some doubts about how the loop work (trying debugging it)
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Change the background of each post according to the category
- Same post appears in related Posts?
- How can I create an RSS feed that includes “Private” posts?
- List latest posts with least comments in WP-Admin
- Change post date in menu to post title
- How to view all posts (on site, not admin) that are uncategorized?
- How to create a list of links to post with specific category
- How can I to add upload functionality outside of the admin area?
- get category in list of posts // shortcode for custom related posts
- Javascript – How do I get specific post fields?
- How to search through “post title” and “tags” using WP_Query?
- What is proper filter or hook action to add data to the $post object?
- WordPress Screen Options, Help, Visual editor, Status, Visibility, Revisions, Published on and any toggled indicator don’t work for posts
- How to reload a post page editor after published?
- Detect if the currently opened document is a post
- Loop through taxonomies and loop through their terms (Newbie question)
- Spam written by registred users
- Post being duplicated with foreach loop
- Numbering author posts in posts query
- Custom post type template not called
- SQL trigger failes with post_content
- WordPress infinite post cycle
- Get from the dashboard the ID of the current post being edited
- How to use Categories of custom post type
- Static text above category page
- WP Blog Page Problems – Been stuck for a week
- Add meta box for Featured Image caption in wp-admin/post-new.php
- Any difference betweenn posts and pages for one page?
- get backup file from wordpress database in x days
- Disable Media uploader to users
- How to get images only attached from edit post page
- I want to send push notification just after publish a new post
- Background image in posts
- Multiple approval from editors before publishing?
- Get new post meta data when (custom) post is saved
- WP Gallery Image Page Issue When 2 galleries share one image
- Adding a category at even positions on main loop with modified pagination
- Given two custom post types: Automatically add meta fields from one custom post type to another
- How can I get a comment ID on Submit?
- Load Pages Menu in single.php
- Display metabox with date
- Rearrange the title, the thumbnail, and the content in a theme template
- Delete old post with new post
- How can i retrive the movies, trailers, news in a single page using search
- Specific Post Format Image Thumbnail
- get post custom value
- Multi Quick Edit – Possible Or Impossible?
- Is there a block to print post link standalone in a block theme?
- Export Posts Without Categories In An XML File
- How to use shortcode to get the second to newest post?