Custom Post Repeater in New Field

Support General Custom Post Repeater in New Field

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4622
    markfivemarkfive
    Participant

    Wanted to create a custom post repeater by extending the select field.

    I've created a new field & added some custom

    if ( class_exists( 'RWMB_Field' ) )
    {
        class RWMB_Glossary extends RWMB_Field
        {
        	/**
    		 * Get field HTML
    		 *
    		 * @param mixed $meta
    		 * @param array $field
    		 *
    		 * @return string
    		 */
    		static public function html( $meta, $field )
    		{
    			/*
    			$my_meta = get_post_meta( $post->ID, 'my_meta_name', true )
    			if( !empty( $my_meta ) ){
    			    foreach( $my_meta as $entry ){       
    			        $post_id = $entry['custom_post'];
    			        $my_post = get_post( $post_id );
    			        $c_title = $my_post->post_title
    			        echo "'".$c_title."' => '".$c_title."', " ;
    			    }
    			}
    			*/
    		}
    
    	
        }
    }

    Any idea how I can output a list of my custom post types here?

    *I actually have the core extensions with me but i'm not sure which works best in this case.

    #4633
    Anh TranAnh Tran
    Keymaster

    Maybe just use get_post_types()?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.