Filter get_page_by_path()
Theres no filter for that function. You can find the code in wp_includes/post.php (Obviously don’t edit it there). Core File
Theres no filter for that function. You can find the code in wp_includes/post.php (Obviously don’t edit it there). Core File
As the error states, WordPress has deprecated the login_headertitle function. You most likely have a plugin or parent theme that is using this function to change the title on your login page. Check to see if there are any updates to your plugin and theme files. Seeing this message also indicates that you have debugging … Read more
Choosing a higher priority for both the script AND the styles seems to work: add_action(‘wp_head’, ‘print_emoji_detection_script’, 8); add_action(‘wp_print_styles’, ‘print_emoji_styles’, 8);
The best place to add this would be in the plugin’s activation hook. You can either call the dynamic activate_{$plugin} hook, or better yet use the provided register_activation_hook method. Using your code example above – something like this would be what you’re looking for: register_activation_hook( __FILE__, function() { $role = get_role( ‘editor’ ); $role->add_cap( ‘edit_booked_appointments’, … Read more
Yes, your code is good. And that my_custom_script is a unique identifier for the script you’re enqueueing. You can find the default script handlers/identifiers here — e.g. jquery for the jQuery library that ships with WordPress. There you can also find more details about the wp_enqueue_script() function, e.g. where should you use the function, the … Read more
I don’t think the plugin is helpful for your case, and you can just call the WordPress API yourself directly: wp_new_user_notification( $user_id, null, ‘both’ ); This is all the plugin does: get’s the user ID from request parameters, verifies the user exists and then calls wp_new_user_notifications (see plugin code here).
You don’t need to store that information, WordPress already does this, and it does this across multiple sessions. If you log in on your phone, and on your PC, then go to your user in WP Admin, you’ll see them listed with a button to log you out on the other devices. Additionally, WordPress stores … Read more
the_title filter has two parameters passed to it, $title and $id. You could use the $id to check the current post type and then do stuff based on that. add_action (‘the_title’ , ‘test’, 10, 2); function test($title, $id) { return ‘post’ === get_post_type($id) ? ‘<div>test</div> ‘ . $title : $title; } The problem with this … Read more
I think you’d have to move the check for whether or not the $location === header into the metabox then use the following to save the meta data. Like this: //In your metabox before the fields $location = get_post_meta( $post->ID, ‘_est_template_location’, true ); if( empty( $location ) || $location != ‘header’ ) : $location = … Read more
require_once( plugin_dir_path( __FILE__ ) . ‘/libraries/action-scheduler/action-scheduler.php’ ); /** * Schedule an action with the hook ‘eg_midnight_log’ to run at midnight each day * so that our callback is run then. */ function eg_log_action_data() { if ( false === as_next_scheduled_action( ‘eg_midnight_log’ ) ) { as_schedule_recurring_action( strtotime( ‘midnight tonight’ ), DAY_IN_SECONDS, ‘eg_midnight_log’ ); } } add_action( ‘init’, … Read more