How to exclude certain files from the plugin editor?

Ok I figured it out, there is just one filter hook in the wp-admin/plugin-editor.php that can be useful but it’s enough (otherwise one would probably need to mess with the output buffer). if(is_admin()){ add_filter(‘editable_extensions’, array($this, ‘my_editable_extensions’)); } and then function my_editable_extensions($editable_extensions){ if(empty($_POST[‘plugin’]) || (!empty($_POST[‘plugin’]) && $_POST[‘plugin’] !== “plugin-name/plugin-name.php”){ return $editable_extensions; }else{ return array_diff($editable_extensions, array(‘txt’, ‘html’)); … Read more

Custom Plugin theme filter

The page_template is a filter, not an action. Specifically it’s filtering the file path of the template to be included. So really you shouldn’t be loading anything in that callback (it’s too early). Instead just return its file path. add_filter( ‘page_template’, ‘load_tq_templates’ ); function load_tq_templates( $template ) { if ( is_page( ‘transport-quote-1’ ) ) { … Read more

How to load library scripts in admin from plugins in noConflict wrapper?

I’m NOT actually Answering the question, I’m putting here, how I got my solution without being on that course: First of all, I got the initial solution to the enqueue problem from WPSE answer. It’s working like a charm. But the problem of conflicting re-occurred when I tried embedding the Media Uploaded to a field … Read more