Hope this helps someone:
Instead of doing this: <a href="https://example.com/folder/edit.php?action=someaction&id=[foocode parameter="value"]&edittoken=[foocode parameter="othervalue"]">linktext</a>
You can do this: [foocode parameter1=value parameter2=othervalue]
and then do this:
add_shortcode( 'foocode', 'prefix_foocode' );
function prefix_foocode( $atts ) {
// Normalize $atts, set defaults and do whatever you want with $atts.
$html="<a href="https://example.com/folder/edit.php?action=someaction&id=" . $atts['parameter1'] .'&edittoken=' . $atts['parameter2'] . '">linktext</a>';
return $html;
}
Related Posts:
- WordPress Shortcode and Dynamic CSS
- Placing raw HTML inside a WordPress shortcode
- Shortcode content output but not in correct place
- How create a Shortcode with hover and complex options
- Using ob_start and ob_get_clean with wordpress shortcode
- Handling PHP/HTML inside the output of a shortcode function
- Calling PHP Titles inside Javascript Markup
- Shortcode displaying at the top of the page [duplicate]
- Shortcode in Shortcode/HTML Graphics and Pictures
- couldnt show short code atts in category
- How can I edit the final HTML structure of the whole web page
- How to return html as a string from php for WordPress
- How can I create a shortcode from an html and php code written together
- Show contact 7 form in popup
- Is there a better way to output HTML as a shortcode?
- add_filter the_content str_replace after shortcode
- Display a text message if the shortcode is not found?
- Run shortcode at certain resolution
- How to use SRCSET with get_the_post_thumbnail()?
- post meta value as shortcode parameter
- How to protect own PHP code from WordPress updates
- How do I make wordpress comment fields required?
- Loading page template into shortcode
- How to add Shortcode (font awesome) in widget title?
- Javascript code inside “” in core WordPress files .php
- Placing the_content inside shortcode not working
- WordPress automatically adds tags when pasting code, how to stop it?
- Autogenerate shortcodes from an array of strings
- How to Insert Shortcodes into Theme?
- Removing unneccessary p-tags (Not every p)
- Custom Theme, Custom shortcode not working
- Why is file_get_contents returning page source?
- Plugin CSS not enqueing
- Showing content from one page on another
- Multiple options not staying selected after saving
- Create own WordPress shortcode gallery
- How to use wp_add_inline_style for custom CSS added via shortcode?
- How to remove ?wp-mce-4103-20162941
- parts of url disappear when using # inside href=”” [closed]
- Dot is not added at the end of href
- Add .htm extention to a custom taxonomy
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Noscript not working as it should in wordpress site
- Excecuting php function in shortcode
- Returning data instead of echoing/printing
- Wrapping a Sidebar within
- HTML escaping data with ajax requests
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- Using Shortcode to Grab Archive Listing, Separate by Year
- HTML table attributes ignored
- How to edit HTML of my website on WordPress? [closed]
- List all blogs, but exclude the main site
- How to rename woocommerce-billing-fields
- PHP code inside Shortcode
- How to add post meta in while loop?
- Adding function to child theme’s function.php
- Action Hook Inside WordPress Plugin Shortcode
- Calling function in loop causes repeat data
- How can I include the user id inside of a shortcode php output?
- PHP Helper Class to create shortcodes
- Link to page with posts of specific type
- Displaying images outside the content
- Updating Metadata with Shortcode
- WordPress User Meta value variable into Google Gauge Chart
- Create shortcode for metabox gallery
- PHP function for horizontal Woocommerce thumbnails and badges
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- separate list of programs in html/javascript coming from php
- Drop down question
- Advanced Custom Forms PHP formatting for do_shortcode
- overwrite wordpress gallery with custom gallery shortcode
- WooCommerce multiple custom fields code
- How to override html codes in wordpress?
- Open/closed function [closed]
- What is wrong with this shortcode? to include external php file in WordPress posts
- Target a specific container to style on WordPress storefront theme
- Need to Echo A Url path to show on a wordpress page
- Create html tree sitemap
- Pass form attributes to another php template in wordpress
- Custom HTML form using PHP – help with ajax/username validation
- How to create a php page to collect information from a html page
- Can’t make product images clickable
- I need help implement a Javascript code into the PHP file
- WooCommerce – Print Processing orders [closed]
- Formatting Shortcode to Display in Visual Mode
- Use html tags in shortcode_atts, is it real?
- How to pass parameter that ends up being part of a class name with wordpress shortcode
- Category – “No content found”
- How to have Function of a plugin using global vars into a shortcode?
- WordPress – Image href for home menu nav not working
- Overwriting a Shortcode
- Cant get theme to change footer color through theme customizer
- A next page function with shortcode?
- using a shortcode in a hyperlink
- Parse error: syntax error, unexpected ‘}’ in
- Display total count of products in orders of a specific order status
- Redirect loop upon installation of my plugin
- ‘This Field is Required.’ is Not Displaying on CF7 [closed]
- How to modify default tags in wp_head()