Hot answers tagged

1

You can use the WordPress functions apply_filters and add_filters to store and retrieve data, like so: // The filter callback function. function so_wp_380975_get_user_args( $array ) { // (maybe) modify $array. // for now, we just return the array return [ 'meta_key' => 'mycred_default', 'orderby' => [ 'meta_value_num'...


1

If you need an SQL query, then this option should be suitable function src_flush_revisions () { global $wpdb; $post_id = 5//exp post id if ( isset( $timeLimit ) ) { $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT `ID` FROM $wpdb->posts WHERE `post_type` = 'revision' AND `post_parent` = %d", $post_id ) ); ...


1

For Date Time just add eg. 00:00:00 - 23:00:00 $month = $_GET['month']; $start_date = date( 'Y-' . $month . '-01 00:00:00' ); $end_date = date( 'Y-' . $month . '-t 23:00:00', strtotime( $start_date ) ); $meta_query = array( 'key' => 'event_start_date', 'value' => array($start_date, $end_date), 'compare' => 'BETWEEN', ...


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