hook for lostpassword form
What happen if you use this instead ? public function processCaptcha() { if($_POST[‘captcha’]!=$captcha){ global $errors; $errors->add(‘invalid’, ‘<strong>ERROR</strong>: invalid captcha.’); } }
What happen if you use this instead ? public function processCaptcha() { if($_POST[‘captcha’]!=$captcha){ global $errors; $errors->add(‘invalid’, ‘<strong>ERROR</strong>: invalid captcha.’); } }
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
Use the hook pre_get_post see codex
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
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
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
Hook event for upload image in the menu
I’m not very sure why you would want to do this is a class, as you can simply make use of spaghetti filter function here. If you really need to do this in a class, there are a few issues with your class We are moving towards PHP 7, and WordPress has eventually woke up … Read more
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; }
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