Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #5476
      dameer
      Member

      Hi!

      Is there any example of how to use Piklist in the plugin that does not extend Piklist itself?

      1. I have Piklist installed as a plugin on my WP 4.4.
      2. I’ve created new plugin files and folders and added checker to my plugin file, like so:

      function e_init_piklist() {
      	
      	if( is_admin() ) {
      		require_once( 'includes/class-piklist-checker.php' );
         		if( ! piklist_checker::check( __FILE__ ) ) return;
      	}
      	
      }
      add_action( 'init', 'e_init_piklist' );

      3. I’ve created Piklist required folder structure in my plugin like so

      my-plugin
      – parts
      — meta-boxes ( with “e-meta-boxes.php” inside )

      4. “e-meta-boxes.php” looks like this:

      /*
      Title: Info
      Description: Whatever description
      Post Type: event
      Collapse: false
      Context: normal
      Priority: high
      Order: 1
      */
      
      // WP's default date format
      // $wp_date_format = get_option( 'date_format' ); // still not working in Piklist
      
      piklist( 'field', array(
      	'type' => 'datepicker',
      	'scope' => 'post_meta',
      	'field' => 'event_from',
      	'label' => esc_attr__( 'Start date' ),
      	'attributes' => array(
      		'class' => 'text'
      	),
      	'options' => array(
      		'dateFormat' => 'd M, yy',
      	),
      ) );

      No matter what I do, meta-box doesn’t show up in my “event” post type.

      Any help is appreciated!

    • #5477
      Steve
      Keymaster

      Make sure you add this to the comment block of your plugin:
      Plugin type: Piklist

    • #5478
      dameer
      Member

      Holy smoke, I obviously overlooked that one! And of course, it works now. Thanks a zillion Steve, I appreciate your speedy response.

      On a side note, just wanted to say THANKS for all of your efforts in regards to Piklist! Amazing framework, the best I ever met, great documentation and support, everything is just right.

      Love ya guys, all the best in 2016!

    • #5479
      Steve
      Keymaster

      @dameer– We really appreciate you using Piklist!

      Your kind words are also appreciated. If you have a few minutes, it would be great if you could give Piklist a 5 Star review on WordPress.org. It really does help the project.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.