New answers tagged

0

Hello i have done dropdown of usermeta and create a wordpress template for getting subscriber info but i am facing some issues 1. when i go to page no.2 the dropdown meta value does not fetch user data 2. when i select option value it does not come up with selected value in dropdown Please have look my template file and guide me what i do '<?php /* ...


4

You're wanting to hide a user from WordPress in three places: The user list in the admin The count above that user list The user's author archive on the front-end As you mentioned, you've already solved item 1 and you've included the code for that. So, I'll provide the solutions for items 2 and 3. The user you want to hide is an administrator with a ...


0

You just need to move the capability check "inwards": function add_qoute_of_the_day_backend( $user ) { $quote = esc_attr( get_the_author_meta( 'qoute_of_the_day', $user->ID ) ); ?> <div class="visible-only-for-admin"> <h3>Quote of the Day Input Field</h3> <table class="form-table" > <tr> ...


1

Creating a table for your WordPress database requires a considerable amount of time. Wordpress Codex has an article with a step by step guide on how to do this, which basically consists of creating a plugin and adding the functions to create a table and trigger the function on plugin install. 1. Creating the Tables: Thew function is this one: <?php ...


1

You should avoid adding new tables or customising the existing tables to add fields for users. If you want to store a phone number etc, do it using user meta: add_user_meta( $user_id, 'riccardo_phone_number', '0123-456-7890' ); .... $phone_number = get_user_meta( $user_id ); User meta is a key and a value with a post ID in the database. There is no need ...


6

Clients get added by admins, clients have a parent child relationship with employees which makes filtering easy. So all we need to do is remove anything that doesn't have to do with employees and filter for employees with a certain meta value. First thing's first, whenever a new user is registered on the admin side of our CMS we will assign it a parent of ...


1

I actually found a cool value for the orderby option in this case. meta_value_datetime It works the same as using strtotime and the date methods in PHP. So here is my final code that started working: $wp_query=new WP_Query(array ( 'post_type' => 'sermon', 'meta_key' => 'sermon_date', 'orderby' => 'meta_value_datetime', ...


1

I don't see anywhere in your code that the query is being modified. Just flagging a column to be sortable doesn't mean it knows how to sort the data - it will just add the little up/down arrow and make the column clickable but you have to intercept the query var accordingly and tell WP what to do. You'll want to hook into pre_get_users and modify the query ...



Top 50 recent answers are included