Questions tagged [pluggable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Changing set password URL in new user 'Login Details' email on Mulitisite network

I'm importing users into a site (SITE_4) within a Multisite network. When the users get their 'Login Details' email, it looks like the following: Username: <username> To set your password, ...
0
votes
1answer
39 views

Is it possible to override only a part of another plugin's / theme's js (asset) file?

I try to go one step forward based on this question and instead of overriding the whole .js file of another plugin, i'm wondering is it possible to override/swap only a part of that js file ...
1
vote
1answer
56 views

the file placed in the child theme is not included

I have modified the theme.php file located in the parent theme in the "Includes" folder, and I have placed it in the child theme also in the "Includes" folder, but my changes are not included. ...
0
votes
0answers
8 views

Pluggable function vs apply_filter for performance

There's a pluggable function and there are filter hooks inside the function. if( ! function_exists('function_name')) { ... apply_filters('hook_name', 'callback funtion'); ... } Which is better ...
0
votes
1answer
31 views

How to target post and pages and not all post types in admin?

I've got a strange issue with a plugin I'm modifying. What happens is that this plugin adds meta boxes in an dashboard options page so scripts and style sheets can be globally added to the header and ...
0
votes
0answers
29 views

I have an fatal error on my funcyions.php

can someone please help me with this Fatal error: Uncaught Error: Call to a member function main() on null in /home/customer/www/real-amnesti.com/public_html/wp-includes/functions.php:1255 I haven'...
-1
votes
1answer
830 views

How to execute init or woocommerce_init only for checkout page

I am making extra function for my own project. function devsol_customer_login() { if ( is_checkout() ) { ?> <form method="post"> <input type="text" class="woocommerce-Input ...
2
votes
1answer
68 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
310 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
418 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
704 views

Override plugin class which has namespace

I would like to override this plugin class in child theme : class-config.php namespace um; if ( ! defined( 'ABSPATH' ) ) exit; if ( ! class_exists( 'um\Config' ) ) { /** * Class Config ...
-1
votes
1answer
2k 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
1answer
497 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 ...
1
vote
1answer
2k 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
1k 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
728 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
155 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
638 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
343 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 ...
2
votes
1answer
207 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
424 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/...
1
vote
0answers
3k 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
33 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
601 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
118 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
198 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
135 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: ...
3
votes
1answer
2k views

Postman: wp_mail has been declared by another plugin or theme

I need use Postman for sending email using an SMTP server, but when installed, it shows this message: Postman: wp_mail has been declared by another plugin or theme, so you won't be able to use ...
0
votes
3answers
2k 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 ...
4
votes
3answers
14k 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
1k 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
245 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
558 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
51 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 ...
3
votes
2answers
788 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 ...
18
votes
8answers
31k 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
926 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
349 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
762 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
2k 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
557 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
445 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
212 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
1k 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
2k 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
162 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
85 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
12k 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 ...