Custom Shortcode and Button not Working after 3.9 update

Try like this: <script type=”text/javascript”> tinymce.init({ selector: “textarea”, toolbar: “mybutton”, setup: function(editor) { editor.addButton(‘mybutton’, { type: ‘splitbutton’, text: ‘My button’, icon: false, onclick: function() { editor.insertContent(‘Main button’); }, menu: [ {text: ‘Menu item 1’, onclick: function() { tinyMCE.activeEditor.execCommand(“myPopup”, false, { title: ‘Divider’, identifier: ‘divider’ })}}, {text: ‘Menu item 2’, onclick: function() {editor.insertContent(‘Menu item 2’);}} ] … Read more

Using audio shortcode for .mp3 URLs with a query string

The problem: The problem seems to be that wp_check_filetype() doesn’t recognize mp3 files with GET parameters. Possible workarounds: You have two options as far as I can see: 1) Override the audio shortcode with the wp_audio_shortcode_override filter. 2) or allow any audio extensions via the wp_audio_extensions filter. Here’s an example how you can implement the … Read more

How execute shortcode with javascript

to execute “ShortCode” which server side-> wordpress ->php ,by JavaScript which client side you will need use AJAX! you can use some thing like: 1-in your enqueued .js file : jQuery(document).ready(function($) { $(‘.buttonClass’).on(‘click’, function() { $.ajax({ url: Param.doShortCode, type: ‘POST’, data: { action: ‘handle_ajax_shortcode’, }, success: function() { //do something on success }, error: function() … Read more

Shortcode with parameters inside parameters

The days of the week shortcodes aren’t needed. Also, the way you’re trying to use them isn’t allowed. Why not just use the title and do what you want in the books shortcode? function books($atts, $content = null) { $atts = shortcode_atts( [ “name” => ”, “day” => ”, “title” => ”, ], $atts ); … Read more

Display a text message if the shortcode is not found?

do_shortcode() returns content with shortcodes filtered out. We can check the return value and display appropriate message accordingly. $output = do_shortcode( ‘[picu_list_collections email=”‘ . $current_user->user_email . ‘”]’ ); // the shortcode returns an empty <ul> tag, if there is no gallery // https://plugins.trac.wordpress.org/browser/picu/trunk/frontend/includes/picu-template-functions.php#L464 if($output == ‘<ul class=”picu-collection-list”></ul>’) echo “Nothing here”; else echo $output; I hope … Read more

Custom Shortcode AJAX 400 Bad Request

The problem is that you’re attempting to use the arguments for the jQuery AJAX API with the native Fetch API. Specifically, the problem is that the JS Fetch API doesn’t support a data argument. For an admin-ajax.php request to work in WordPress the $_REQUEST[‘action’] property needs to be populated, and to do this with the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)