Plugin templates vs Parent Theme
Plugin templates vs Parent Theme
Plugin templates vs Parent Theme
captcha not working in my custom plugin
The wp_dropdown_roles() function internally uses get_editable_roles() to fetch the needed roles. It does nothing else than fetching the roles from the global: $all_roles = $GLOBALS[‘wp_roles’]->roles; and filter it afterwards: return apply_filters( ‘editable_roles’, $all_roles ); So you can simply add the following function to a plugin or your functions.php file of your theme: function wpse137935_filter_editable_roles( Array … Read more
If your scripts can be printed in the footer add the enqueue to the definition of getDeck, with the final argument set to true. I.e in your plugin file function getDeck( $deckId ) { wp_enqueue_script( $handle, $src, $deps, $ver, true ); //do other stuff }
date_error seems to be a function of that class, so you’ll have to use add_action(‘edit_user_profile’, array($this, ‘date_error’)); However I am not entirely sure that’ll work because I don’t know when this function is called. It might already be too late to register the hook.
Plugin generated virtual pages
Custom code for WordPress dynamic menu
How to remove default style of header in wordpress metabox
Make sure to add it to a hook that fires at or after ‘wp’ ; Example: add_action( ‘wp’, ‘your_function_name’); function your_function_name(){ global $post; $your_page_id = get_option(‘your_option_name’); if( $post->ID == $your_page_id ): //your include endif; }
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