Your if statement wants the user to be able to posts AND pages, which only applies to admins and editors by default. Are you sure editors cannot see the buttons? If you want anybody who can edit posts to see the buttons (e.g. authors and contributors) take out the check for edit_pages
or make it an or statement (which is an unlikely situation in most installs, but I suppose it could happen).
So, instead of:
if ( current_user_can('edit_posts') && current_user_can('edit_pages') )
Use
if ( current_user_can('edit_posts') )
or
if ( current_user_can('edit_posts') || current_user_can('edit_pages') )
Related Posts:
- How to customize the “Insert/edit link” popup box?
- Disable emojicons introduced with WP 4.2
- remove_action or remove_filter with external classes?
- Passing a parameter to filter and action functions
- Difference Between Filter and Action Hooks?
- How to know what functions are hooked to an action/filter?
- Get a list of all registered actions
- How can I edit post data before it is saved?
- add_action(), add_filter() before or after function
- How do I include a TinyMCE editor in the frontend?
- How to create an API for my plugin?
- Switch between Visual and HTML tab freely
- Trouble understanding apply_filters()
- What is the very earliest action hook you can call?
- Creating a wp_editor instance with custom tinyMCE buttons
- remove custom post type permalink
- Where is the best place to use add_filter
- How to add custom CSS (theme option) to TinyMCE?
- Remove Actions/Filters added via Anonymous Functions
- wp_headers vs send_headers. When to use each?
- How to add “Insert/Edit link” button in custom popup tinymce window?
- Remove HTML editor and visual/HTML tabs from TinyMCE
- How to disable TinyMCE from removing span tags
- WordPress automatically adding ” “?
- Add popup window to TinyMCE buttons
- Is there any action filter/hook for validating a custom field before publishing the post?
- How to customize TinyMCE4 in WP 3.9 – the old way for styles and formats doesn’t work anymore
- No filter of code on switch from html to visual editor, how?
- TinyMCE editor is breaking my beautiful HTML
- How many filter/action hooks are healthy?
- WordPress 3.9 – Trouble Editing TinyMCE 4.0
- How to get the input of a TinyMCE editor when using on the front-end?
- Earliest hook to reliably get $post/$posts
- Removing buttons from the editor
- Load wp_editor via ajax [duplicate]
- Remove Editor From Homepage
- Enqueue Script After TinyMCE initialized
- How to use tinyMCE for user “biographical info”?
- What does (10, 2) mean when used with add_filter
- Why did multiple line breaks stop working in text editor?
- How to only hook on Single.php after content?
- TinyMCE 4.x : How to customize toolbar on wp_editor()
- Valid characters for actions, hooks and filters
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- Modify links when inserted by WYSIWYG editor
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- Stop editor from removing tags and replacing them with nbsp
- How to check if a hook is hooked or not?
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Completely strip any hidden formatting when pasting into TinyMCE
- Replace Taxomony Description Field with Visual/WYSIWYG Editor
- Implementing advanced add_* function wrappers
- How to replace the content of tinyMCE editor in both text and visual mode using jQuery?
- Unable to add “code” button to TinyMCE toolbar
- TinyMCE format dropdown no longer showing style previews
- Is it possible to use object in add_action?
- How i can i add a split button or list box to the WordPress TinyMCE instance
- TinyMCE in customizer
- Possible to stop WordPress from adding p1, p2… classes to p tags in TinyMCE?
- How to set custom cookies before output
- Custom Tiny MCE button to bring up a custom php popup
- WordPress 3.2 has broken my TinyMCE code
- wp_editor disable after reaching character count limit
- Tiny MCE editor stripping xlink:href parameter from SVG USE tag
- When switching from html to visual editor the tag gets corrupted
- Is it possible to re-use the image details popup?
- Markup of oEmbed codes in the editor?
- How to correctly get post type in a the_title filter
- Visual Tab Missing From Editor
- How to use the new Dashicons for custom TinyMCE buttons?
- Add unique class or ID information to tinyMCE
- How to publish a post with empty title and empty content?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How to restrict actions and filters “properly” by conditions
- Is it possible to create nested lists in the WYSIWYG editor?
- How can I stop TinyMCE from converting my HTML entities to characters?
- Add a button to tinyMCE editor on Custom Post Type
- TinyMCE Anchor Button not showing
- add_filter OO with parameters
- How to keep non-breaking spaces in the visual editor?
- Get list of registered or enqued styles? looking for filters or actions
- Why, Where, and When to use reference pointers in filters/hooks?
- Is there a way to prevent the Editor from modifying my HTML
- Using add_filter() in Widgets
- How to add a “publish” link to the quick actions
- Cite-Tag for blockquotes
- Wait for Gutenberg or built something in ACF?
- How do I Make a Theme “plugin-ready”?
- Better way to enforce category hierarchy in post_categories_metabox?
- Replicating the_editor (Media Bar, TinyMCE, Visual/HTML Tabs) functionality without a huge rewrite
- “wp_editor” not displaying TinyMCE correctly when square brackets used in name
- HTML5, WordPress and Tiny MCE issue – wrapping anchor tag around div results in funky output
- Store source permalink on XMLRPC calls
- Remove “Are You Sure” dialogue when leaving editor
- How can I filter Microsoft Word gunk from pasted content?
- Secure Validation of wp_editor in Theme Options
- Creating a custom MCE view for your shortcodes [closed]
- Detecting when TinyMCE is “ready”
- How to make post and comment count unclickable with dashboard_glance_items hook
- Using a dashicon for a custom button in TinyMCE?