Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pluggable]

The tag has no usage guidance.

3
votes
1answer
59 views

What is the criteria for pluggable functions?

Why are certain functions pluggable (overrideable) in WordPress core and others not? (I note on the Codex page regarding Pluggable Functions no more are to be added in favour of filter usage.) But ...
1
vote
1answer
39 views

is_user_logged_in() not working in AJAX validation call

Update: Error was a simple typo, disregard this question. I'm using the jQuery validate plugin to validate some forms. When I try to validate something using the is_user_logged_in() function, I get ...
0
votes
0answers
91 views

is_tax not working for custom taxonomy

I am trying to over-ride a custom taxonomy file from my plugin. Actually, I have 2 custom taxonomies: destination & activities. I have successfully over-ridden the taxonomy template for activities ...
0
votes
1answer
55 views

Override plugin class which has namespace

I would like to override this plugin class : class-config.php namespace um; if ( ! defined( 'ABSPATH' ) ) exit; if ( ! class_exists( 'um\Config' ) ) { /** * Class Config * * ...
-1
votes
1answer
269 views

Adding placeholder text field to woocommerce checkout [closed]

I am trying to add placeholder text to checkout page but it is not displaying any placeholder text on the first name and last name.It is displaying a new text field with the palceholder text which i ...
0
votes
2answers
189 views

Overriding a plugin's pluggable function in theme's function

I came across this snippet - https://gist.github.com/mikejolley/1751128 - that creates a function with the same name as an existing WC function as a means of overriding it. I also learnt that this ...
0
votes
1answer
453 views

Calling an API to do authentication / user login

I'm relatively new to wordpress and am working on a customized site. I have an API endpoint that I'd like to call to do authentication, because our users are going to have their credentials stored/...
3
votes
1answer
460 views

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-...
0
votes
1answer
246 views

Call to undefined function get_userdata in user.php

My website error log is full of [lsapi:error] [...] Backend fatal error: PHP Fatal error: Call to undefined function get_userdata() in /home/.../public_html/wp-includes/user.php on line 460 ... ...
0
votes
1answer
70 views

Prevent sending emails on user creation in OOP context?

I need to block any user creation email on the site, and I tried overriding any pluggable function that is responsible for mail sending. The only thing that works is $this->loader->add_filter( '...
0
votes
2answers
243 views

How to override get_avatar() function?

I need for a specific plugin to override the wordpress function get_avatar() to bind the profile image to an other image with some condition. How can I do this ? Is there a specific hook or filter to ...
0
votes
1answer
257 views

Repeated headers in wp_mail

I am passing a custom header multiple times, for tagging reasons, to wp_mail(), but only the last instance of the header is actually getting sent. It appears that wp_mail() is filtering the custom ...
3
votes
1answer
113 views

WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way

I'm quite new to WordPress development. I'm using WordPress 4.9.2. I'm currently working on the following issue. I have several blog categories which have no relation to each other. For example "Our ...
1
vote
0answers
310 views

How to override Woocommerce functionality in Reports section?

I need to customize the Reports in WooCommerce, so I have to edit the core file class-wc-report-sales-by-date.php, such file doesn't use any hook. Check: https://github.com/woocommerce/woocommerce/...
0
votes
0answers
2k views

Extend plugin Class through functions.php

Move manual fix applied to plugin source code to theme functions.php or as Code Snippet I've applied a manual fix to a plugin file. I'd like to make this fix more accessible and scalable by hooking ...
0
votes
1answer
24 views

Wordpress reading old version of functions.php, breaks site

I added a function to the child theme functions.php to check if a plugin class exists. The code was something like function check_class_exists() { if (class_exists('classname')) { echo "...
0
votes
2answers
402 views

overwrite code snippet from parent to child theme

I'm trying to overwrite following code in the child theme. I want to load file /inc/soundtheme-admin.php from child folder. I copied same code snippet in child-theme/functions.php and also copied the ...
0
votes
1answer
76 views

Set up functions to be overridden without using function_exists() by short-circuiting them?

A few years ago I read an article about short-circuiting functions with apply_filters() rather than using pluggable functions via function_exists(). I love the idea because of how flexible it is- I'm ...
1
vote
0answers
163 views

Replace part of a parent-theme customizer in the child-theme

I'm created a child-theme of the OnePress theme and would like to update a part of the inc/customizer.php function. Specifically, the theme customizer adds the following control: $wp_customize->...
0
votes
1answer
116 views

Bug in pluggable.php? [closed]

Can anyone help out here? For several months by now, we start getting problems right after bringing up our website. (we had to restore old pluggable.php to avoid this error) Fatal error: ...
2
votes
0answers
887 views

Postman: wp_mail has been declared by another plugin or theme

I need use Postman for send email using SMTP server, but when install show message: Postman: wp_mail has been declared by another plugin or theme, so you won't be able to use Postman until the ...
0
votes
3answers
1k views

Providing fallback function and allow override by plugin

I'm using ACF (Advance Custom Fields) plugin in my theme. This plugin provides a simpler methods get_field() which we can use in place of WordPress native get_post_meta() method. Now, the issue is the ...
2
votes
3answers
9k views

turn off new user registration emails

I would like to turn off the emails that the admin gets when a new user registers. We are getting a lot of emails because of new registrations (they are legitimate registrations) but I just don't ...
0
votes
1answer
835 views

Wordpress Registration Email by Role

I'm wanting to send out a custom html email to a new user based on their role during registration. So, I have 2 roles that will be specifically registering on the site: photographer and subscriber and ...
6
votes
1answer
229 views

How to override a function when isn't at functions.php

I am trying to override a function for a theme in the child-theme but I can't get it to work. At functions.php on the theme I can see this require_once line: require_once("inc/alterna-functions.php");...
0
votes
0answers
437 views

Pluggable Function wp_new_user_notification exists too early

I have recently updated from 4.1 to 4.4 directly and I can't override wp_new_user_notification anymore. Obviously the function should not exist when the plugins are loaded. I wrote a mu-plugin with ...
0
votes
1answer
48 views

Solution dealing with Child Theme / Parent theme functions

This week I was struggling a bit customizing an exsisting theme for a client. To prevent the theme from being overwritten each update I created a child theme. This allowed me to cusomize most of the ...
5
votes
2answers
635 views

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 ...
11
votes
6answers
17k views

Disable email notification after change of password

I want to disable the emailnotification if a user or an admin changes the password of a user. After some Googleling I came to find that I need to create a plugin and overwrite the ...
0
votes
1answer
2k views

How to override filter in child theme?

I'm trying to override a parent theme filter in a child theme; I must have the syntax wrong as the override is being completely ignored. Here's what's in my child theme's functions.php: //* remove ...
4
votes
1answer
822 views

How to overwrite a JavaScript core function?

Since the newest WP version 4.3.1, there's a change in the WordPress core JavaScript file: /wp-admin/js/edit-comments.js At line 376, the WordPress dev added a check for how many table columns there ...
1
vote
2answers
294 views

override pluggable.php functions

I just not only want to override a pluggable function (wp_new_user_notification) but I want to make sure that if any other plugin is overriding the same function, so my function , override that too or ...
1
vote
1answer
600 views

Current user in plugin returns NULL

I am currently developing a plugin and I am trying to make use of the $current_user global. class Something { public function __construct() { $this->get_user(); var_dump( $this->user )...
0
votes
1answer
1k views

How to override this theme function in child theme

I'm working in a child theme and I need to override a function in order to remove some unwanted items on a top menu. So I have research a bit and found a lot of docs, really, like this, this and this ...
0
votes
1answer
1k views

remove_action not removing add_action from constructor

I am trying to replace a message from a function that got hooked in a constructor from a class from woocommerce. This is what I tried to remove the message: What I tried. function remove_actions() {...
0
votes
0answers
526 views

Integrate WP Tiles into existing loop (index.php) and theme

I want to integrate WP Tiles directly into our Wordpress theme and into our existing loop but their documentation is pretty thin and I can't find much in the way of examples so not really sure how to ...
1
vote
0answers
419 views

Override default new user registration email with custom message (non sub-domain multi-site installation)

My problem is as follows. I have a multisite running on a non-sub-domain install. I am trying to customise the welcome email a user receives upon registration. I managed to customise the welcome ...
0
votes
1answer
175 views

save_post hook - headers already sent?

I'm trying to create a very simple alert for each time a post is created or updated with the below... add_action( 'save_post', 'updatedAlert' ); function updatedAlert() { echo '<script>alert("...
3
votes
2answers
846 views

Editor access to plugin settings

I'm trying to give access to an user with the role Editor to this plugin settings page: https://wordpress.org/plugins/commenter-data/ In the code of this plugin on line 31 of commenter.php there is ...
0
votes
1answer
1k views

Override email_exists function

I am trying to override the email_exists function to modify the way it works slightly. It is not listed as a pluggable function so I am unsure how to go about it. I would like thef following to ...
1
vote
3answers
107 views

Best way to modify a plugin with no hooks and no pluggable functions?

I have to make some changes to some functions in a plugin that don't have hooks and aren't pluggable. My idea was to wrap the functions I modify in a if ( ! function_exists()) and move my ...
0
votes
1answer
69 views

pluggable function in theme, to be overridden by plugin

Is it possible to add a function in functions.php like this: // ACF if ( !function_exists('get_field') ) { function get_field() { return false; } } and then let ...
3
votes
2answers
9k views

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 ...
0
votes
1answer
44 views

Overide enqueue in non plugable function via child theme

I am trying to override a non-plugable function using the information on this page but it seems to have no effect. Can anyone see what's wrong. My code is remove_action('wp_print_styles', '...
3
votes
1answer
2k views

function triggered by “manage_users_custom_column” filter not working

I am trying to add a custom column un users.php but it stays empty. I have successfully added a column to the users admin page with this code in my theme's functions.php file: function ...
0
votes
1answer
328 views

Removing sensitive information from comment notifications - notify_post_author

Basically I need to remove or comment our lines 1114 - 1116 in pluggable.php, and edit line 1113 These are the lines $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->...
4
votes
1answer
1k views

How does Wordpress resolve permalinks internally?

I am doing some deep modding of the rewrite system and custom post_types but before I can continue I must find out how WordPress handles the rewrites. I found the function url_to_postid() but ...
0
votes
2answers
218 views

Filter a pluggable function

The following function is pluggable as it contains a filter : // Make function pluggable/overwritable if ( ! function_exists( 'wpsight_layout_images' ) ) { function wpsight_layout_images() { ...
0
votes
1answer
1k views

Undefined constant error in pluggable.php

Ok, so to preface this question, I think this error is caused by the plugin I am developing. I actually am trying to create a v2 of the plugin, and every time I try to overwrite the plugin files in ...
1
vote
2answers
139 views

Nonce generated 0-12 hours ago

In WordPress there's a nonce generating/verifying mechanism, and I'm having trouble understanding why it's not working correctly... At a point it checks for whether the nonce was generated 0-12 hours ...