Override pluggable functions in a plugin?

WordPress has a file called pluggable.php which contains a list of functions you can override in your plugin. The problem I am facing (I am overriding wp_authenticate) is for each blog in my network I try to activate this plugin, I get: failure, can’t re-declare wp_authenticate which was previously declared in pluggable.php This somewhat defeats … Read more

Convert hyphen to underscore in permalinks

I would like to use underscore in my permalinks instead of hyphen. Current permalink: www.example.com/2013/01/hello-this-is-a-test-post/ Desired permalink www.example.com/2013/01/hello_this_is_a_test_post/ I have tried some solutions mentioned here in stacexchange. But they were not working. 3 Answers 3 it can be done easily without any codes or plugin just go to pages dashboard, click Quick Edit” which url … Read more

Why allow overriding crucial pluggable functions wp_verify_nonce and wp_create_nonce?

Among the functions in /wp-includes/pluggable.php are the functions wp_verify_nonce and wp_create_nonce. Both functions are very important in the protection against CSRF-attacks. However, it is easy to override these functions in a plugin so that all nonces are accepted as valid. if( ! function_exists(‘wp_verify_nonce’) ) { function wp_verify_nonce($nonce, $action = -1) { return 1; } } … Read more

Removing custom meta box added in parent theme

I am using a child theme, and wish to change one of the meta boxes defined in the parent theme. The meta box is for ‘pages’ only. I tried using the remove_meta_box in my functions.php, but it has no effect: function remove_parents_box() { remove_meta_box( ‘id-of-meta-box’ , ‘page’ , ‘normal’ ); } add_action( ‘admin_menu’ , ‘remove_parents_box’ … Read more

How do I override template-tags.php in twentyseventeen theme

I created a child theme from the TwentySeventeen theme and it seems to work. I can override the content.php file by creating a matching folder and my own content.php in my child theme. /template-parts/post/content.php …Works fine. However, I tried to do the same thing to override the metta tags in the header of a single … Read more

WordPress 3.1 – How does one add sticky post capabilities to post types

In wordpress 3.1 they finally added the option of allowing posts belonging to a custom post type to be marked as “sticky”… what I can’t figure out though is how to enable this so the admin menu option shows up. I was thinking it might have something to do with the “supports” argument when the … Read more

Is it possible to override this function/class in a child theme?

Is it possible to override this widget function from a parent theme? I saw this blog, but it dealt with a simpler case. http://venutip.com/content/right-way-override-theme-functions parent class Chocolat_Widget_New_Entrys extends WP_Widget { function __construct() {… function widget( $args, $instance ) {… } add_action( ‘widgets_init’, create_function( ”, ‘return register_widget( “Chocolat_Widget_New_Entrys” );’ ) ); I attempted to use remove_action(‘widgets_init’,’???’); … Read more

syntax for remove_filter in parent theme with class

I’m trying to remove a filter on the register_url hook a parent theme added, that seems to have a class nomenclature I can’t figure out. Ordinarily, a filter for this hook would be easily added like so: add_filter( ‘register_url’, ‘custom_register_url’ ); function custom_register_url( $register_url ) { $register_url = “YOUR_PAGE_URL”; return $register_url; } However, the parent … Read more