How to change the URL of sub menu page?

As per the requirement in the comments, one way to do that rewrite is with .htaccess. This may be possible with WordPress rewrite functions too, but I find .htaccess easier as there are some constraints with the WordPress functions. If your WordPress installation is at http://localhost/wordpress then your .htaccess should be in the wordpress directory. … Read more

How to display content if user meta data isn’t empty with shortcode

Your shortcode can look like this: [check-if-empty usermeta=”last_name”] Is not empty [/check-if-empty] The parameter called “usermeta” is added to your function ($atts) and it’s value is used to check the userdata. function func_check_if_empty( $atts, $content = null ) { if ( is_user_logged_in() ) { /* check if logged in */ $user_meta = $atts[‘usermeta’]; /* get … Read more

JS POST update data taxonomies

In this case you issue your ID while you have to look for the “name” or “value”. if( isset( $_POST[‘user_activities-‘.$useractivitie->slug] ) ) Change to: if( isset( $_POST[‘user_activities’][$useractivitie] ) )

Conditional editing CPT – using editor’s role and author’s usermeta

I manage to filter the posts, this seems to be enough for this project function remove_notallowed_authors( $query ) { $user = wp_get_current_user(); if ( in_array( ‘editor_group_role’, (array) $user->roles ) ) { $user_ids = get_users( [ ‘role’ => ‘user_role_that_posted’, ‘fields’ => ‘ID’ ] ); $query->set( ‘author__in’, $user_ids ); } } add_action( ‘pre_get_posts’, ‘remove_notallowed_authors’ );

Join Query on WP_USERMETA Table

function get_users_email ($time_zone_cont, $class_group){ // Add Lisa’s user id, 14, in an array. $exclude_list = array( ); $Time_Zone = $time_zone_cont; $user_class_group = $class_group; $args = array( // ‘role’ => ‘Editor’, // ‘exclude’ => $exclude_list, ‘meta_query’ => array( // ‘relation’ => ‘OR’, array( ‘key’ => ‘Time_Zone’, ‘value’ => $Time_Zone, ‘compare’ => ‘=’ ), array( ‘key’ => … Read more