- This topic has 2 replies, 1 voice, and was last updated 4 weeks, 1 day ago by .
-
Topic
-
Hey guys!
I have two different scenarios. On the first one, I load my metaboxes accordingly to the post being edited, grabbing from the theme settings which box should be loaded for each specific post type (it’s part my my theme settings panel):
$post_id = null; if ( isset( $_GET['post'] ) ) { $post_id = intval( $_GET['post'] ); } elseif ( isset( $_POST['post_ID'] ) ) { $post_id = intval( $_POST['post_ID'] ); } $post_type = get_post_type($post_id);
After getting the post_id on the edit, screen, I query my THEME OPTIONS and load only the boxes assigned to the current CPT. Everything works like a charm, however, the ‘add_to_wpseo_analysis’ => true’ gets ignored.
So, I moved to the second scenario and loaded a simple textarea metabox on the traditional way, as a text.
$cpt = 'post'; $meta_boxes[] = array( 'id' => 'meta-'.$cpt.'-test', 'title' => 'Test', 'pages' => array($cpt), 'context' => 'side', 'priority' => 'low', 'fields' => array( array( 'id' => $cpt.'-textarea-test', 'type' => 'textarea', 'desc' => __('Ex: Estúdio Teia Local', 'tl'), 'add_to_wpseo_analysis' => true, ), ) );
…and it is not counted as well.
Any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.