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?
- search and replace preword from author
- Embed html in php code
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- WP grandchild categories in nested ul li
- Use DOMDocument with ob_start breaks my HTML code
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Colon is Missing In My Website Url in WordPress
- How to change redirection route to a php page for making it only accessible by logged-in members?
- Custom shortcode outputs plain text instead of HTML at top of post
- selected option if current category is the value
- How to use wp_add_inline_style for custom CSS added via shortcode?
- Pass php dynamic variable to shortcode
- How can I dynamically update the class in my shortcode?
- Creating own shortcode – echoeing php variable based on JS variable
- How to remove ?wp-mce-4103-20162941
- Customize position of social icons in upme plugin [closed]
- Why Won’t My Inputs in a form with a Get method work together?
- parts of url disappear when using # inside href=”” [closed]
- Settings API callback function inserts html quotes from nowhere
- Input data from email form not going to JSON file
- How to get the value of input hidden html from text editor to custom page template?
- Different post styles depending on category
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Remove from shortcode
- Dot is not added at the end of href
- WordPress Multiple Navigation bars
- Position banner to right of logo in header – messed up my header file
- Displaying recent posts on static page with template-part via shortcode
- Commenting out unwated CSS/scripts in HTML with PHP
- wordpress 4.4 self hosted video (html5) doesn’t show
- do_shortcode with custom field
- How to Reference/Echo Variable from Another PHP Function
- Remove echo from shortcode
- Replace shortcode in substring
- How to separate HTML and WordPress files
- Add .htm extention to a custom taxonomy
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Shortcode to show the code
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Shortcode returns values in the wrong order
- Make PHP work with HTML tags
- Get URL from shortcode tag
- Embedding PHP in shortcode $content
- Noscript not working as it should in wordpress site
- Show latest posts in a plain HTML website custom widget [closed]
- Shortcode with PHP issue “Undefined index”
- How to convert select to HTML with PHP tags inside of it [closed]
- Excecuting php function in shortcode
- Only first shortcode gets executed
- Is this spyware on my site or a real Java update?
- Multiple do_shortcode in page template
- Syntax error when I try to insert my loop into an unordered list? [closed]
- How to make modifications only to certain elements of an HTML string on the server-side?
- Returning data instead of echoing/printing
- Wrapping a Sidebar within
- echo something inside a shortcode
- Search WordPress using static html page
- Hide HTML element (by class or ID) with PHP
- displaying content that includes shortcodes within an echo
- List taxonomy term slugs within shortcode (do_shortcode)
- Shortcode from a function not working
- Add Codepen animation as Preloader to WordPress
- Path for php file for inserting data through html form
- Function returns text instead of html [closed]
- Display Data in Table from External Database in WP using Shortcodes
- get_posts works in the page template but not in a shortcode
- Printing HTML codes
- Is it possible to return content, and then also continue to do other things?
- Widget back end radio button issue
- ::before on open/close function [closed]
- anyway to put inside a $outprint=sprintf()
- HTML escaping data with ajax requests
- How i can get post data from database when i am getting post id from url in wordpress
- How to retrieve the data from the sever and displaying it in a page?
- Is There A Way To Make Theme Files Accept Shortcodes?
- php within html within php
- How can I include shortcodes within PHP?
- How to execute html code inside php?
- How to remove coupon dropdown feature
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Create a WordPress shortcode using PHP [duplicate]