WordPress.org

Forums

Theme's shortcodes no longer working with WP3.9 (5 posts)

  1. lowlight
    Member
    Posted 1 year ago #

    My theme is no longer supported by the developer, so I am wondering if someone can help me figure out how to get my WYSIWYG shortcode buttons to work again?

    Despite looking like they would work in my custom-functions.php file, it didn't work.

    Any help would be appreciated, thanks!

  2. Dave Naylor
    Member
    Posted 1 year ago #

    You need to include as much information as possible. Providing the theme name, site URL and examples of failing code would be a start.

  3. lowlight
    Member
    Posted 1 year ago #

    Hi, the theme name is named "Newsroom" and can be found at themeforest.

    The site is HCW PC Gaming Reviews

    The code is in a separate theme file called "theme_shortcodes.php" and these are the contents:

    [ 697 lines of code moderated, that's just way too much. For that many lines of code please use pastebin.com instead. ]

    The shortcodes work fine on the site, I just lost the shortcuts to them in the WYSIWYG editor. This makes it difficult, since I can't remember how they are structured.

  4. Dave Naylor
    Member
    Posted 1 year ago #

    The move to version 4 of TinyMCE in WordPress 3.9 has had an effect on plugins and themes that add buttons to the editor tool bar. I noticed that you'd posted a support thread at your commercial theme designer's site, it's a shame they're being unresponsive.

    I found this page at wpexplorer where adding items to the new tool bar is discussed:

    http://www.wpexplorer.com/wordpress-tinymce-tweaks/

    Maybe you can replace your old buttons that way.

  5. lowlight
    Member
    Posted 1 year ago #

    I'm not exactly a programmer, but it looks like the code is the same as what he's using.

    His example:

    // Register new button in the editor
    function my_register_mce_button( $buttons ) {
        array_push( $buttons, 'my_mce_button' );
        return $buttons;
    }

    My theme:

    // Add TinyMCE buttons
    function wpbandit_mce_buttons($buttons) {
    	array_push($buttons, 'separator', 'wpbandit_button');
    	return $buttons;
    }

    His example to call the javascript:

    // Declare script for new button
    function my_add_tinymce_plugin( $plugin_array ) {
    	$plugin_array['my_mce_button'] = get_template_directory_uri() .'/js/mce-button.js';
    	return $plugin_array;
    }

    My theme:

    // Add TinyMCE plugins
    function wpbandit_mce_plugins($plugin_array) {
    	$plugin_array['wpbanditShortcodes'] = get_template_directory_uri() . '/air/theme/tinymce/tinymce.wpbandit.js';
    	return $plugin_array;
    }

    Could the problem be that my theme is using different PHP files other than functions.php to call the buttons? It has several other files it uses in a subdirectory of the main theme.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic