You could try using the enclosing form to write the shortcode and make use of the $content returned variable.
You need to declare you short code function with the extra parameter:
function transciptor( $atts="", $content ) {
and then write your shortcode as:
[transcript]
place the value that
will be passed to
$content here
[/transcript]
Note the alternative syntax for the shortcode. There is information about it in the codex here.
If the p tags are still there I see two other options. Don’t enclose your shortcode parameter in paragraph tags, i.e.
'.$value['text'].'
instead of
<p>'.$value['text'].'</p>
or you could parse the p tags from the variable with something like:
$value['text'] = str_replace("<p>", "", $value['text']);
$value['text'] = str_replace("</p>", "<br>", $value['text']);
Related Posts:
- How do I use Shortcodes inside of HTML tags?
- WordPress Shortcode and Dynamic CSS
- ob_get_clean returns empty string, ob_get_flush outputs string
- How to create shortcodes that pull custom field data from general settings
- Creating a WordPress shortcode
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- Get list of shortcodes from content
- Audio tags around Mp3 URL in content
- How do I hardcode a WordPress shortcode into my theme?
- has_shortcode() – how to detect nested shortcode
- Wrap each shortcode in array to div
- How do I turn a shortcode into PHP code?
- Put php variable in shortcode
- Placing raw HTML inside a WordPress shortcode
- How do I add text in a shortcode?
- Template part inside shortcode, unexpected reult
- Shortcode Inside Class Not Working
- Shortcode content output but not in correct place
- Shortcode API: How to get name that matched shortcode RegEx?
- Shortcode content filter?
- How to display posts by current user in a drop down
- Get value from shortcode to do something
- Colon is Missing In My Website Url in WordPress
- Custom shortcode outputs plain text instead of HTML at top of post
- Pass php dynamic variable to shortcode
- wordpress 4.4 self hosted video (html5) doesn’t show
- Shortcode returns values in the wrong order
- Embedding PHP in shortcode $content
- Shortcode with PHP issue “Undefined index”
- Excecuting php function in shortcode
- Returning data instead of echoing/printing
- get_posts works in the page template but not in a shortcode
- ::before on open/close function [closed]
- Is There A Way To Make Theme Files Accept Shortcodes?
- 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]
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- Syntax error in a shortcode function
- Using Shortcode to Grab Archive Listing, Separate by Year
- Unable to process php via shortcode
- Help with WordPress function inside a shortcode
- calling a custom field value inside functions.php
- Using ob_start and ob_get_clean with wordpress shortcode
- WordPress shortcode returns the data before
- List all blogs, but exclude the main site
- Cant display an image via PHP in wordpress
- How to make a conditional statement within $output in shortcodes.php?
- help with custom shortcode that stopped working
- Shortcode for a Series of Elevating Image Files, Excluding a Range?
- Shortcode won’t execute
- AJAX function not working [closed]
- Can ‘Custom Field’ data be inserted into this Short Code?
- how to get sentence values from wordpress shortcode parameter?
- Set document title through shortcode plugin
- How do I reopen the (Popup Maker) after entering the correct password for a password protected page?
- Not able to remove caption shortcode from the content
- Get title of page containing post grid within the posts
- Shortcodes not processing inside post content
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- wpdb->query returns different value to phpMyAdmin
- Time Stamp In A WordPress Post Title That Does Not Keep Refreshing
- How can I edit the final HTML structure of the whole web page
- I am having an issue with this shortcode plugin.. Warning: Illegal string offset ‘title’
- I want to hide “sold by” on certain pages with id page 43
- How to add a PHP scripts into WordPress
- How can I create a shortcode from an html and php code written together
- Multiple Arrays for Custom Post Query using Boostrap accordions and ACF repeater fields
- Replacing entire tag with shortcode – JavaScript [duplicate]
- CPT in a shortcode
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Get posts by id using shortcode
- Shortcode just with a php code
- WordPress Shortcode based on other shortcode
- Force ‘permanent’ post cache of shortcode results
- Wrapping shortcode content in a span or link
- Custom fields changes the formatting of metabox input
- Use html tags in shortcode_atts, is it real?
- Contact form field in wordpress menu
- php string inside shortcode does not work
- Limit the number of successful logins
- Shortcodes (with a space) added to php Sample
- How to have Function of a plugin using global vars into a shortcode?
- How can I put a custom field as the link of a button shortcode?
- Where to place PHP for shortcodes
- How to wrap a text with shortcode into php file?
- PHP Widget and do_shortcode
- Problem using explode inside add_shortcode() callback funciton [closed]
- Shortcode not passing variable to included file
- Php inside the shortcode is getting commented
- Display Current Time using shortcode
- How to create shortcode of this PHP code
- WP Custom tables query
- Display terms on product page with shotrcode
- Custom plugin with shortcode not working
- How to edit a widget code?
- Calling a function via a shortcode in javascript
- Woocomerce custom add to cart button edit functionality [closed]
- I have a php function with a shortcode to add share buttons, but I’m having an error!
- Nav Menu Short code Not working When non Login
- Automatically populating a date parameter within a shortcode