0
votes
1answer
135 views

Notice: Use of undefined constant SECURE_AUTH_COOKIE and LOGGED_IN_COOKIE 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
1answer
46 views

Overriding a function in wordpress

A theme that I bought is adding unnecessary inline JS code that is not needed in the front page. /* Scripts - dynamic css */ add_action('wp_footer', 'upme_custom_scripts'); function ...
3
votes
1answer
114 views

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 ...
1
vote
2answers
2k views

Adding a second email address to a completed order in WooCommerce

Before I ask this question, I know there is a (legitimate) hesitation to answer questions here about Woo products since they have their own support and their users should be encouraged to use that. I ...
2
votes
3answers
2k views

How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?

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

How to add custom function to pluggable.php

I am working on a WP plugin and I want to add a custom function to pluggable.php (located in /wp-includes). I am calling that function from admin.php (located in /wp-admin) eg. Consider the function ...
2
votes
2answers
323 views

why plugins are loaded prior to pluggables

I got this image from one E-book for WP plugin development. Could you please clarify me why the Plugins are loaded before Pluggables.
0
votes
1answer
1k views

overwrite a plugin function in functions.php

need to customise a plugin function but would rather not edit the plugin itself so updates wont remove the custom changes. function iss in a class called UserAccessManager and the function is; ...
0
votes
2answers
622 views

Editing wp-config.php

I need to add the line define('WP_POST_REVISIONS', false); to my config.php , so that post revisions are disabled. I don't have access to wp-config.php, I have permission to edit my theme and ...
1
vote
2answers
529 views

Overriding functions in wordpress plugins

I notice that in some plugins you can override functions by ... Creating an uploads folder Creating a folder with the plugin name Using the following code if (!function_exists('function_name')) { ...
207
votes
108answers
88k views

Best Collection of Code for your functions.php file [closed]

Please vote on the question and any answers you find useful by clicking on the UP arrow on the left hand side of the question or answer. As with many others who are now viewing this post, I have been ...