Add table button in editor without Plugin

i use this custom button for ad’s in TinyMCE, i use JavaScript code to add/develop this one look into this code: jQuery(document).ready(function ($) { tinymce.create(‘tinymce.plugins.wpse72394_plugin’, { init: function (ed, url) { // Register command for when button is clicked ed.addCommand(‘wpse72394_insert_shortcode’, function () { selected = tinyMCE.activeEditor.selection.getContent(); if (selected) { //If text is selected when button … Read more

Always paste as a text in visual editor

function tinymce_paste_as_text( $init ) { $init[‘paste_as_text’] = true; return $init; } add_filter(‘tiny_mce_before_init’, ‘tinymce_paste_as_text’); For details please follow link : tiny_mce_before_init Thanks!

Multiple choice in a custom taxonomy

To display multiple authors, loop through the array of authors: function show_product_autor(){ $authors = wp_get_post_terms( get_the_ID(), ‘autor’ ); foreach($authors as $author) { $authorTeamPg = get_page_by_title( $author->name, ‘OBJECT’, ‘team’ ); $authorTeamPgLink = get_permalink( $authorTeamPg->ID); echo “<b>AUTOR: </b><a href=”https://wordpress.stackexchange.com/questions/289422/{$authorTeamPgLink}”>{$author->name}</a>”,'<br />’; } } To handle editors, the simplest solution IMO would be to make the taxonomy heirarchical and … Read more

Getting a 404 error when clicking edit page

You mentioned that you disabled all plugins, and changed the theme (I assume you used one of the ‘twenty’ themes, which is what I usually do when trying to find theme/plugin problems). Did you also look at the ‘must use’ plugins (in wp-content/mu-plugins ) (see https://codex.wordpress.org/Must_Use_Plugins ). Maybe a plugin in there is causing problems. … Read more

Programmatically allow a non-author to edit a post based custom meta field

Looking at current_user_can()‘s documentation, I see that it uses WP_User::has_cap(). So if your code (or the WP core code) uses something like current_user_can( ‘edit_post’, $post->ID ) to determine if the current user can edit the current post, you can use the user_has_cap filter (called in WP_User::has_cap()): add_filter( ‘user_has_cap’, ‘wpse360937_allow_manager’, 10, 4 ); function wpse360937_allow_manager( $allcaps, … Read more

Do not change the order of the tags in the editor

Terms/Tags aren’t ordered. To help make the terms easier to read, the editor will list them alphabetically, but that isn’t because they’re ordered alphabetically in the database. It’s because a piece of javascript sorted the terms in the UI control. There is no order, only the order you give them. Fundamentally terms have no order. … Read more