Tag Info

Hot answers tagged

4

If you don't feel any performance degradation then there is no problem. If it took you two years to get to this state then you probably safe for another two years, which is almost forever in the time scale of the internet (unless you are CNN or similar). This doesn't mean that you should not try and save space wherever it is easy to do. Do you really need ...


2

You can still use get_posts: $parents = get_posts( array( 'posts_per_page' => -1, 'post_type' => 'my_custom_post_type', 'fields' => 'ids', // Just get IDs, not objects 'tax_query' => array( array( 'taxonomy' => 'my_custom_tax', 'field' => ...


1

The most likely cause is that the hook is probably running multiple times (e.g. once per meta field). You may need to qualify/filter your function like so… add_action( 'added_post_meta', function ( $mid, $object_id, $meta_key, $_meta_value) { global $wpdb; if ( $meta_key != 'data19' ) { return; } $table_name = $wpdb->prefix . 'postmeta'; ...


1

I peeked into the WP_User_Query class and it supports a WP_Date_Query query on the user registration date. So we could use: $query = new WP_User_Query( $args ); or simply: $users = get_users( $args ); where: $args = [ 'fields' => 'ID', 'number' => 8, 'date_query' => [ [ 'before' => '359 days ago midnight' ], ...


1

First of all you are trying to combine both of the tables by post_parent. $wpdb->posts.post_parent = $wpdb->ftcalendar_events.post_parent I guess data in the ftcalendar_events has children of posts table, try $wpdb->posts.ID = $wpdb->ftcalendar_events.post_parent Also you can try joining tables: SELECT * FROM $wpdb->posts JOIN ...


1

For me the problem would be to use a plugin that uses evil() eval() to evaluate string as PHP, in the first place ;-) This part is from the PHP manual: Caution The eval() language construct is very dangerous because it allows execution of arbitrary PHP code. Its use thus is discouraged. If you have carefully verified that there is no other option ...



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