AP_Question_Meta_Box::add_meta_box( string $post_type )

Description #

Hook meta boxes in post edit screen.

Parameters #

  • $post_type
    string (Required) Post type.

Source #

File: admin/meta-box.php

	public function add_meta_box( $post_type ) {
		if ( 'question' === $post_type ) {
			add_meta_box(
				'ap_answers_meta_box',
				// translators: %d is answers count of a question.
				sprintf( __( ' %d Answers', 'anspress-question-answer' ), ap_get_answers_count() ),
				array( $this, 'answers_meta_box_content' ),
				$post_type,
				'normal',
				'high'
			);
		}

		if ( 'question' === $post_type || 'answer' === $post_type ) {
			add_meta_box( 'ap_question_meta_box', __( 'Question', 'anspress-question-answer' ), array( $this, 'question_meta_box_content' ), $post_type, 'side', 'high' );
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment