Regarding the code that is being inserted into the pluggable.php file: its a require statement that links to a php file that is used to overwrite the basic wp mail functionality. Thanks in advance.
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 ... and the site does not load (blank page, no source). The only changes that were recently made are Wordpress and plugin updates (I don't know which ones and when); no programming of any kind. This answer made me suspect that a plugin did override get_userdata, but a recursive search for function get_userdata in the …
I want to disable the email notification if a user or an admin changes the password of a user. After some Googling I came to find that I need to create a plugin and overwrite the wp_password_change_notification function found in pluggable.php. This is the plugin and function: <?php /* Plugin Name: Stop email change password Description: Whatever */ if ( !function_exists( 'wp_password_change_notification' ) ) { function wp_password_change_notification() {} } ?> I uploaded the file to my plugin folder and activated …
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 do this ?
on a word press site i am trying to build, i am trying to get a listing of current news feeds from reliable sourced on a specific topic. In the WordPress RSS options, is there a way to set up a feed, and have it only pull news articles with a specific key word? if so, where do i go to set that up? If not is there a script or a plugin that can be used to have a …
I need to override the function get_cancel_comment_reply_link or cancel_comment_reply_link that are defined in wp-includes/comment-template.php These functions are not listed in pluggable.php. How can I override them from my theme's functions.php? I tried remove_filter('get_cancel_comment_reply_link', 'cancel_comment_reply_link'); add_filter('get_cancel_comment_reply_link', function($text='') { return ''; }, 1, 1); without success.
More precisely questions : How to override email_exists via get_user_by ? I have chosen to render unusable/unreadable email adresses from database. I added a few elements(chars) to email address just after sending email to admin and user (user registration), and then I must remove these added elements to verify if email exists or display on user account or use for mailing list. To decrypt the email I must use substr whith the value associated to $email field of get_user_by to …
I get the following error when trying to login: Error: Cookies are blocked due to unexpected output. I customized the wordpress core functions wp_hash_password() and wp_check_password() to use SHA1 algorithm for user authentification instead of MD5. I modified them in the pluggable.php file (not best practice but good for testing). The functions now look like this: function wp_hash_password( $password ) { global $wp_hasher; if ( empty( $wp_hasher ) ) { $wp_hasher = sha1( $password ); } return $wp_hasher->HashPassword( trim( $password …
I want to replace the currency shorten alphabet, it is currently in M, L and So on. I want to change to indian currency number format like K, L and CR below is code: if(!function_exists('houzez_number_shorten')) { function houzez_number_shorten($number, $precision = 0, $divisors = null) { $number = houzez_clean_price_20($number); if (!isset($divisors)) { $divisors = array( pow(1000, 0) => '', // 1000^0 == 1 pow(1000, 1) => 'K', // Thousand pow(1000, 2) => 'M', // Million pow(1000, 3) => 'B', // Billion …
The current result is "PHP Fatal error: Call to undefined function wp_get_current_user()" which makes sense, but doesn't help. I need to use $current_user. Here is the code I'm currently using: $wp->init(); do_action( 'init' ); // Check site status $file='http://xxxxxxxx.com/wp-admin/wp_includes/pluggable.php'; if ( is_multisite() ) { if ( true !== ( $file = ms_site_check() ) ) { require( $file ); die(); } unset($file); } // Get the current user's info $current_user = wp_get_current_user(); if ( !($current_user instanceof WP_User) ) return; echo $current_user->user_login; …
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 dynamically? To somehow maybe 'inject'/ import my own function(s) additionally into that specific file safely (and fairly natively:)?
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 Postman until the conflict is resolved. I've uninstalled all unnecessary plugins; but it still does not work. Searching all files for wp_mail() and the other plugins that use wp_mail() are: ./wp-content/plugins/nextgen-gallery/freemius/includes/class-freemius.php ./wp-content/plugins/planso-forms/includes/submit_notifications.php I need these plugins and I don't understand how to resolve this issue. …
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. WordPress only reads the file placed in the parent theme folder. What is the reason for this? What should I do the modifications are included when the file is located in the child theme folder? Alternatively, how can I override a function from includes/theme.php in …
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 footer areas of a site via wp_footer() andwp_header()`. This plugin also adds one meta box to each page and post editor, and I think that's where the problem is; it also adds meta boxes to other plugin admin panels, which of course I …
As with many others who are now viewing this post, I have been reading various blogs, forums, and discussion groups to learn and improve my WordPress skills. Over the past 12 months I have been on a mission to substitute my use of plugins by adding code to my functions.php file instead. While I completely agree that plugins are very useful in many situations, my experience proved that in 90% of usage cases although a plugin might exist, actually utilizing …
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't edited anything in the functions.php or any code for that matter.
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 * * Class with global variables for UM * * @package um */ class Config { //some code here... } //end class } But as you can see, this class uses a namespace, so I can't just write this in my functions.php : functions.php class …
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.