WordPress parent select need to be removed

Per comments a way around it is to set the post_type to something that isn’t a hierarchical type in the filter, as the wp_dropdown_pages() function used to populate the select calls get_pages() which just returns without doing anything if the post_type isn’t hierarchical. So using a non-existent post_type works: function limit_parents_wpse_106164( $args ) { $args[‘post_type’] … Read more

wp_editor with media buttons

You can use following code to achieve this if ( is_user_logged_in() ) { // Editor without media buttons wp_editor( $content, ‘editorname’, array(‘media_buttons’ => false) ); } else { // Editor with media buttons wp_editor( $content, ‘editorname’); }

Detect a focus on wp_editor

You can pass an array of settings to the editor instance. For possible values please refer to the tinymce documentation, in your case ‘init_instance_callback’ might be helpful. https://www.tinymce.com/docs/configure/integration-and-setup/#init_instance_callback wp_editor(”, ‘sedemoeditor’, array( ‘tinymce’ => array( ‘init_instance_callback’ => ‘function(editor) { editor.on(“focus”, function(){ console.log(“Editor: ” + editor.id + ” focus.”); }); }’ ) ));

Load tinyMCE / wp_editor() via AJAX [duplicate]

your post here helped me figure a solution. Along with the mceInit property, I also had to retrieve the qtInit that wp_editor generates as well. The following is the relevant code within my class. Basically I have wp_editor run so that the javascript is generated. I use hooks to retrieve the javascript, so that I … Read more

Hide old attachments from wp media library

You can adjust the attachment query in the media library popup, through the ajax_query_attachments_args filter. Here are two PHP 5.4+ examples: Example #1: Show only attachments that where uploaded during the last 24 hours: /** * Media Library popup * – Only display attachments uploaded during the last 24 hours: */ add_filter( ‘ajax_query_attachments_args’, function( $args … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)