Ultimate TinyMCE Shortcodes

Below, you’ll find a detailed guide on how to add the Ultimate TinyMCE Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Ultimate TinyMCE Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Ultimate TinyMCE Plugin and the shortcodes it provides:

Plugin Icon
Ultimate TinyMCE

"Ultimate TinyMCE is a comprehensive WordPress plugin that enhances and expands the functionality of the default TinyMCE editor, providing users with a multitude of additional features and customization options."

★★★★✩ (145) Active Installs: 20000+ Tested with: 3.7.41 PHP Version: false
Included Shortcodes:
  • [field name="meta_key"]
  • [signoff]

Ultimate TinyMCE [field] Shortcode

The Ultimate-Tinymce plugin shortcode ‘field’ retrieves post metadata. It accepts ‘name’ as an attribute and returns the value of the specified metadata. This shortcode allows users to display custom field data dynamically, enhancing content customization.

Shortcode: [field name="meta_key"]

Parameters

Here is a list of all possible field name=”meta_key” shortcode parameters and attributes:

  • name – specifies the meta key of the post’s custom field

Examples and Usage

Basic example – The shortcode is used to fetch and display the post meta data associated with a given name.

[field name="author"]

Advanced examples

Using the shortcode to display post meta data for a custom field. The field name is ‘book_title’.

[field name="book_title"]

Another advanced usage is when the shortcode is used to display post meta data for multiple custom fields. The field names are ‘book_title’, ‘book_author’, and ‘publication_year’.

[field name="book_title"]
[field name="book_author"]
[field name="publication_year"]

Please note that these are examples only and the field names will need to be replaced with the actual field names used in your WordPress post meta data.

PHP Function Code

In case you have difficulties debugging what causing issues with [field name="meta_key"] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('field', 'jwl_field_func');

Shortcode PHP function:

function jwl_field_func($atts) {
   global $post;
   $name = $atts['name'];
   		if (empty($name)) return;
   return get_post_meta($post->ID, $name, true);
}

Code file location:

ultimate-tinymce/ultimate-tinymce/admin_functions.php

Ultimate TinyMCE [signoff] Shortcode

The Ultimate-Tinymce plugin shortcode ‘signoff’ is used to customize the sign-off text in a post. Upon invoking, it fetches the sign-off text stored in the ‘jwl_options_group3’ option group. This allows users to have a consistent sign-off message across their posts.

Shortcode: [signoff]

Examples and Usage

Basic example – Displays the signoff text set in the Ultimate TinyMCE plugin options.

[signoff /]

PHP Function Code

In case you have difficulties debugging what causing issues with [signoff] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('signoff', 'jwl_sign_off_text');

Shortcode PHP function:

function jwl_sign_off_text() {
	$options = get_option('jwl_options_group3');  
	if (isset($options['jwl_signoff_field_id'])) {
		$jwl_signoff = $options['jwl_signoff_field_id'];
	}
    return $jwl_signoff;  
}

Code file location:

ultimate-tinymce/ultimate-tinymce/options_functions.php

Conclusion

Now that you’ve learned how to embed the Ultimate TinyMCE Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *