/** * AJAX handler that outputs the taxonomy sections for a given post. * Requires the Post ID and it's selected Post Type. * * @since 3.1 */ function wprss_ftp_ajax_taxonomy_for_post_type() { // Get POST data $post_id = isset( $_POST['post_id'] )? $_POST['post_id'] : NULL; $post_type = $_POST['post_type']; // Get the saved meta data $meta = WPRSS_FTP_Meta::get_instance()->get( $post_id, 'taxonomies' ); // Check if post has old taxonomies options if ( $meta === '' ) { $meta = WPRSS_FTP_Meta::convert_post_taxonomy_meta( $post_id ); } echo wprss_ftp_taxonomy_sections( $post_type, $meta ); die(); }
/** * Renders the taxonomies metabox * * @since 3.1 */ public function render_taxonomies( $post ) { $meta = $this->get( $post->ID, 'taxonomies' ); $post_type = $this->get( $post->ID, 'post_type' ); // Check if post has old taxonomies options if ( $meta === '' ) { $meta = self::convert_post_taxonomy_meta( $post->ID ); } ob_start(); echo wprss_ftp_taxonomy_sections( $post_type, $meta ); ?> <tr id="wprss-ftp-taxonomies-add-section" class="wprss-tr-hr"> <th> <button type="button" class="button-secondary" id="ftp-add-taxonomy"> <i class="fa fa-fw fa-plus"></i> <?php _e( 'Add New', WPRSS_TEXT_DOMAIN ); ?> </button> <?php echo WPRSS_Help::get_instance()->do_tooltip( WPRSS_FTP_HELP_PREFIX.'taxonomies' ); ?> </th> <td></td> </tr> <?php return ob_get_clean(); }
/** * Renders the taxonomies dropdown * * @since 1.0 */ public function render_post_taxonomy( $args ) { $settings = $this->get( 'taxonomies' ); // Check if has old taxonomies settings if ( $settings === '' ) { $settings = self::convert_post_taxonomy_settings(); } $post_type = $this->get( 'post_type' ); ob_start(); ?> </td></tr></table> <div id="wprss-ftp-taxonomy-table-container" style="postition: relative; max-width: 800px; display: block;"> <table id="wprss-ftp-taxonomy-table" class="form-table wprss-form-table"> <tbody> <?php echo wprss_ftp_taxonomy_sections( $post_type, $settings ); ?> <tr id="wprss-ftp-taxonomies-add-section" class="wprss-tr-hr"> <th colspan="1"> <button type="button" class="button-secondary" id="ftp-add-taxonomy"> <i class="fa fa-fw fa-plus"></i> Add New </button> <?php echo WPRSS_Help::get_instance()->do_tooltip( WPRSS_FTP_HELP_PREFIX.'taxonomies' ); ?> </th> <td></td> </tr> </tbody> </table> </div> <table style="display: none"><tr><td> <?php echo ob_get_clean(); }