Hot answers tagged

5

I'm not aware of any other way but to use both add_action lines, for a single function. Example: function my_enqueue_sripts_function_name(){ // your enqueue logic here } add_action('wp_enqueue_scripts', 'my_enqueue_sripts_function_name' ); add_action('admin_enqueue_scripts', 'my_enqueue_sripts_function_name' ); There's no rule that forbids ...


2

It sounds as though you know your username and password, but if not you can always go into PHPMyAdmin (Or whatever Db tool your server uses) and navigate to the users table. In there you can see your users, and edit your details as required, including your password which you can simply overtype with new after encrypting it in MD5 format. If this is trying to ...


1

(As you said, this is not specifically a Wordpress question except for how to hook into Wordpress functionality with users. Here are some thoughts) I think there are some design questions you need to have clear in order to make it easy figuring out the order to build things: Users signing up and signing in to your Wordpress website is easy, Wordpress does ...


1

So I changed this in the wp-config.php file: define( 'AUTH_KEY', 'put your unique phrase here' ); define( 'SECURE_AUTH_KEY', 'put your unique phrase here' ); define( 'LOGGED_IN_KEY', 'put your unique phrase here' ); define( 'NONCE_KEY', 'put your unique phrase here' ); define( 'AUTH_SALT', 'put your unique phrase here' ); define( '...


1

I have a somewhat similar requirement to you. Currently I am using the below to test for the correct scenario: if ( is_user_logged_in() == true || in_array($GLOBALS['pagenow'], array('wp-login.php')) || strpos($_SERVER['REQUEST_URI'], 'wp-admin') != 0) This doesn't detect if you have changed the login URLs but you could define Globals or plugin ...


1

If you're flexible about adding a plugin to get this functionality, you could use: https://wordpress.org/plugins/login-logout-register-menu/ It simply adds a very convenient section in the menu builder. You can combine it with another plugin to restrict what menu items are shown to logged in users, which ones to logged out users, and which ones to everyone.


Only top voted, non community-wiki answers of a minimum length are eligible