2 weeks ago from meta query meta value

This is my meta query within my posts query.

'meta_query' => array(

                array(
                    'key' => 'rw_membership_ends',
                    'value' => ???????
                    'compare' => '>=',
                    'type' => 'DATETIME'
                ),

 )

I want to select posts that have rw_membership_ends (in datetime format) older than the current value of the rw_membership_ends filed minus 14 days.

Read More

What should I put in ‘value’ ?

I need something like

'meta_query' => array(

                array(
                    'key' => 'rw_membership_ends',
                    'value' => 'rw_membership_ends_value' - 14 days
                    'compare' => '>=',
                    'type' => 'DATETIME'
                ),

 )

Related posts

Leave a Reply