Use external link in the add sub menu

Last argument of function add_submenu_page is the name of the function to call when display the content of the page. As described here: http://codex.wordpress.org/Function_Reference/add_submenu_page The right use is: add_submenu_page( ‘antify’, ‘Plugins’, ‘Plugins’, ‘manage_options’, ‘plugins’, ‘my_function’ ); function my_function(){ echo ‘hello’; } If you want a separate file you can do this add_submenu_page( ‘antify’, ‘Plugins’, ‘Plugins’, … Read more

How to Remove a Filter from the Admin List Table?

I can see that it’s implemented inside the class WC_Admin_List_Table_Orders which extends WC_Admin_List_Table. Yes, that’s correct. And the orders list table is setup via WC_Admin_Post_Types::setup_screen() where the method is called via these hooks: (see WC_Admin_Post_Types::__construct()) // Load correct list table classes for current screen. add_action( ‘current_screen’, array( $this, ‘setup_screen’ ) ); add_action( ‘check_ajax_referer’, array( $this, … Read more

How do I change parameters without changing the core

If you scroll further down the comment-template.php file, you’ll notice that the next available filter you can use is comment_form_defaults. With this filter you can change the default comment form configuration. add_filter( ‘comment_form_defaults’, ‘filter_comment_form_defaults’ ); function filter_comment_form_defaults( $defaults ) { $defaults[‘comment_field’] = sprintf( ‘<p class=”comment-form-comment”>%s %s</p>’, sprintf( ‘<label for=”comment”>%s</label>’, _x( ‘Please leave a comment…’, ‘Comment … Read more

function ‘wp_enable_block_templates’ not found

Just to be sure, is “last WordPress version” the 5.8? wp_enable_block_templates is a function added in the version 5.8 of WordPress. You should find it in wp-includes/theme-templates.php as you can see here. Check if that function is actually present in your file. If not, probably something gone wrong during the updating. How did you do … Read more

How to Remove the “Restore” Link in Quick Edit?

This will do: add_filter(‘post_row_actions’, ‘wpse_56560_remove_untrash’, 10, 2); add_filter(‘page_row_actions’, ‘wpse_56560_remove_untrash’, 10, 2); function wpse_56560_remove_untrash( $actions, $post ) { if( !isset( $actions[‘untrash’] ) ) return $actions; // If NOT administrator, remove Untrash if( !current_user_can(‘administrator’) ) unset( $actions[‘untrash’] ); return $actions; }

Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied

I had the same problem. You need to reclassify the mediaelement style and script, like it is explained in this post. So just call this funtion, after your ajax call: function enqueue_mediaelement(){ wp_enqueue_style( ‘wp-mediaelement’ ); wp_enqueue_script( ‘wp-mediaelement’ ); } add_action( ‘wp_enqueue_scripts’, ‘my_enqueue_scripts’ ); If you wanna add your own styles for specific pages (in the … Read more

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