Hot answers tagged

3

I am assuming your custom post type is also "series". Can you try this, it should work. $args = [ 'post_type' => 'series', 'posts_per_page' => -1, 'meta_query' => [ [ 'key' => 'series', 'value' => 19, 'compare' => '=', 'type'=>'NUMERIC' ] ...


2

add_action( 'save_post', array( $this, 'save_metabox', 10, 2 ) ); should be add_action( 'save_post', array( $this, 'save_metabox' ), 10, 2 ); If you enable debugging, you'll see a call_user_func_array error generated by this. Also, a few other things- You should check if $_POST['anotai_nonce'] is set before trying to use it in assignment on the first ...


2

"You should not write to the DB on front end requests" is the eleventh commandment. Your performance will deteriorate due to the writes locking down the table much more than the impact the size of the table will have. You should probably write such data in files instead of DB, or at least use a different table.


1

This function should be displaying both modified and published dates only if they differ. if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } Dates are compared using ...


1

The meta_value field is longtext, which a quick google reports is 4,294,967,295 characters - I doubt you're exceeding that. Chances are it's an issue with PHP, specifically post_max_size - if this is less than the "huge amount of data" you are referring to, PHP will simply truncate $_POST and you end up with nothing.


1

Fields in database tables can not contain other types of data than text strings and numbers, and variations of them like dates and times. The field meta_value of wp_postmeta is a text field. So, when you store an array as meta_value you are really storing a string containing the serialized data that represents the original array. If you need to interpret ...


1

It's should be return rather than echo. return '<meta name="site_title" content="'.'test test'.'">'."\n";



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