Title: [Plugin: Shortcode Exec PHP] Invalid argument error when edeitor uses shortcode TinyMCE button
Last modified: August 20, 2016

---

# [Plugin: Shortcode Exec PHP] Invalid argument error when edeitor uses shortcode TinyMCE button

 *  Resolved [cruxwireweb](https://wordpress.org/support/users/cruxwireweb/)
 * (@cruxwireweb)
 * [14 years ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-invalid-argument-error-when-edeitor-uses-shortcode-tinymce-button/)
 * Hi-
 * Can anyone figure this one out?
 * I have two users on this new site I am setting up. One is administrator account
   and one is an editor account. Originally, both accounts could use the shortcode
   button in TinyMCE with no problem. However, when I added descriptions to my shortcodes(
   previously only one had a descrip), then the problem arose. When I use the admin
   account, the shortcode button in TinyMCE works fine, but when using the editor
   account, I get this error when the shortcode selection box pops up:
 *     ```
       Warning: Invalid argument supplied for foreach() in .../wp-admin/includes/plugin.php on line 1261
       ```
   
 * This happens both in FF and Chrome.
 * The code at error code location is the remove_menu_page function. In my functions.
   php, this is my only use of remove_menu_page:
 *     ```
       function delete_menu_items() {
       		if ( current_user_can( 'editor' )) {
       			remove_menu_page( 'link-manager.php' );
       			remove_menu_page( 'tools.php' );
       			remove_menu_page( 'wpcf7' );
       		}
       	}
       	add_action( 'admin_init', 'delete_menu_items' );
       ```
   
 * My shortcode descriptions contain no punctuation other than commas and periods,
   and one has underscores referring to the title of other shortcodes, but no brackets.
 * Interestingly, I’m getting the error message 3 times, but I have 8 shortcodes.
   However, no 3 shortcode descriptions share a notable characteristic.
 * In the shortcode selection popup (for the editor), the selection drop-down menu
   does show up after the errors, and all 8 shortcodes are there. I’m able to insert
   a shortcode and it works.
 * I’m using the _s theme.
 * If an export of my shortcodes would be helpful, please let me know.
 * Thanks,
    Kim
 * [http://wordpress.org/extend/plugins/shortcode-exec-php/](http://wordpress.org/extend/plugins/shortcode-exec-php/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [M66B](https://wordpress.org/support/users/m66b/)
 * (@m66b)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-invalid-argument-error-when-edeitor-uses-shortcode-tinymce-button/#post-2771960)
 * I don’t think this is a problem of Shortcode Exec PHP.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Shortcode Exec PHP] Invalid argument error when edeitor uses
shortcode TinyMCE button’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-exec-php.svg)
 * [Shortcode Exec PHP](https://wordpress.org/plugins/shortcode-exec-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-exec-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-exec-php/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-exec-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-exec-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-exec-php/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [M66B](https://wordpress.org/support/users/m66b/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-invalid-argument-error-when-edeitor-uses-shortcode-tinymce-button/#post-2771960)
 * Status: resolved