Y
Y
Ylyaru2014-11-07 01:00:19
TinyMCE
Ylyaru, 2014-11-07 01:00:19

Installed theme "Shortcodes" buttons disappeared from the Wordpress editor after updating to version 4.0. Where do you need to fix?

When updating the engine to Wordpress 4.0, the shortcodes buttons disappeared in the TinyMCE 4.1.3 post editor , the theme is based on bootstrap.
The “pack” itself consists of a separate folder in which the composition is shown below,
482178765.png
the code of the “shortcodes.php” file is here

define( 'SC_DIR', get_template_directory()  .'/inc/'.  basename( dirname( __FILE__ ) ) ) ;
define( 'SC_URL', get_template_directory_uri()  .'/inc/'.   basename( dirname( __FILE__ ) ) );	
    require_once('dnp_alerts.php');
    require_once('dnp_blockquote.php');
    require_once('dnp_blog.php');
    require_once('dnp_buttons.php');
    require_once('dnp_code.php');
    require_once('dnp_collapse.php');
    require_once('dnp_contact.php');
    require_once('dnp_gmap.php');
    require_once('dnp_grid.php');
    require_once('dnp_icons.php');
    require_once('dnp_images.php');
    require_once('dnp_labels.php');
    require_once('dnp_lists.php');
    require_once('dnp_popover.php');
    require_once('dnp_portfolio.php');
    require_once('dnp_progress.php');
    require_once('dnp_service.php');
    require_once('dnp_social.php');
    require_once('dnp_tables.php');  
    require_once('dnp_tabs.php');
    require_once('dnp_team.php');
    require_once('dnp_testimonial.php');
    require_once('dnp_thumbnails.php');
    require_once('dnp_typo.php');
    require_once('pricing_table.php');

class DNP_Shortcodes {
  
  function __construct()
  {
    require_once('shortcodes.php'); //был отключен
    add_action( 'init', array( &$this, 'init' ) );
    add_filter( 'admin_head', array( &$this,'jsdata' ) );
  }
  
  function init(){
    if ( ! current_user_can('$edit_posts') && ! current_user_can('edit_pages') ) {
      	return;
    }
    if ( get_user_option('rich_editing') == 'true' ) {
      add_filter( '$mce_external_plugins', array(&$this, 'regplugins') );
      add_filter( '$mce_buttons_3', array(&$this, 'regbtns') );
      wp_enqueue_style('dnp_shortcodes', get_template_directory_uri().'/inc/shortcodes/assets/css/shortcodes.css');
    }
  }
  
  function jsdata (){
    echo '<script type="text/javascript">var sc_url = "'.SC_URL.'";</script>';
  }
  
  function regbtns($buttons)
  {
  
      array_push($buttons, 'dnp_alerts');
      array_push($buttons, 'dnp_labels');
      array_push($buttons, 'dnp_code');
      array_push($buttons, 'dnp_blockquote');
      array_push($buttons, 'dnp_icons');
      array_push($buttons, 'dnp_buttons');
      array_push($buttons, 'dnp_collapse');
      array_push($buttons, 'dnp_grid');
      array_push($buttons, 'dnp_tabs');
      array_push($buttons, 'dnp_progress');
      array_push($buttons, 'dnp_gmap');
      array_push($buttons, 'dnp_social');
      array_push($buttons, 'dnp_service');
      array_push($buttons, 'dnp_images');
      array_push($buttons, 'dnp_lists');
      array_push($buttons, 'dnp_popover');
      array_push($buttons, 'dnp_tables');
      array_push($buttons, 'dnp_thumbnails');
      array_push($buttons, 'dnp_typo');
  }

  function regplugins($plgs)
  {
    $plgs['dnp_alerts'] = SC_URL.'/assets/js/plugins/alert.js';
    $plgs['dnp_blockquote'] = SC_URL.'/assets/js/plugins/blockquote.js';
    $plgs['dnp_buttons'] = SC_URL.'/assets/js/plugins/buttons.js';
    $plgs['dnp_code'] = SC_URL.'/assets/js/plugins/code.js';
    $plgs['dnp_collapse'] = SC_URL.'/assets/js/plugins/collapse.js';
    $plgs['dnp_gmap'] = SC_URL.'/assets/js/plugins/gmap.js';
    $plgs['dnp_grid'] = SC_URL.'/assets/js/plugins/grid.js';
    $plgs['dnp_icons'] = SC_URL.'/assets/js/plugins/icons.js';
    $plgs['dnp_labels'] = SC_URL.'/assets/js/plugins/labels.js';
    $plgs['dnp_modals'] = SC_URL.'/assets/js/plugins/modals.js';
    $plgs['dnp_progress'] = SC_URL.'/assets/js/plugins/progress.js';
    $plgs['dnp_service'] = SC_URL.'/assets/js/plugins/service.js';
    $plgs['dnp_social'] = SC_URL.'/assets/js/plugins/social.js';
    $plgs['dnp_tabs'] = SC_URL.'/assets/js/plugins/tabs.js';
    $plgs['dnp_images'] = SC_URL.'/assets/js/plugins/images.js';
    $plgs['dnp_lists'] = SC_URL.'/assets/js/plugins/lists.js';
    $plgs['dnp_popover'] = SC_URL.'/assets/js/plugins/popover.js';
    $plgs['dnp_tables'] = SC_URL.'/assets/js/plugins/tables.js';
    $plgs['dnp_thumbnails'] = SC_URL.'/assets/js/plugins/thumbnails.js';
    $plgs['dnp_typo'] = SC_URL.'/assets/js/plugins/typo.js';
    return $plgs;
  }


}
$dnpcodes = new DNP_Shortcodes();

in the "functions.php" of the theme, the shortcodes are written like this:
/**
 * Shortcodes
 */
include_once( 'inc/shortcodes/shortcodes.php' );

What's the catch? Maybe someone knows?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Elena, 2014-11-07
@Nidora

Did you backup before the update? If so, you can return the folder.

Y
Ylyaru, 2014-11-07
@Ylyaru

Backup did not. Engine and template on the local machine. Of course, the option to return the old version, but the update is faster and better than the previous version.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question