Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Custom Post Type in a Piklist workflow tab #2480
    norboo
    Member

    And of course it works! Steve, how can I buy you beer?
    Solved! Solved! Solved!

    I added the following code in my functions.php to remove the Placemarks menu from Admin and everything works as expected.

    function remove_menu_items() {
        if( !current_user_can( 'administrator' ) ):
            remove_menu_page( 'edit.php?post_type=your_post_type' );
        endif;
    }
    add_action( 'admin_menu', 'remove_menu_items' );
    in reply to: Custom Post Type in a Piklist workflow tab #2475
    norboo
    Member

    Steve,
    I really hope I won’t give you too much headache.

    This is the code I use for the Workflow Tab (piklist/parts/workflows):

    <?php
    /*
    Title: Company Address
    Order: 40
    Flow: User Test
    */
     piklist('include_user_profile_fields', array(
        'meta_boxes' => array(
    		'Company Address'
        )
      ));
     
      
      piklist('shared/code-locater', array(
        'location' => __FILE__
        ,'type' => 'Workflow Tab'
      ));
    
    ?>

    And this is the code for the field (piklist/parts/users):

    <?php
    /*
    Title: Company Address
    Order: 10
    */
    ?>
    <h2>Company Address</h2>
    <?php
    
    	$current_user = wp_get_current_user();
    	$user_meta = get_user_meta($current_user->ID);
    	
    	$placemark = get_posts(array('post_type' => 'bgmp','author' => $current_user->ID));
    	$address = get_post_meta( $placemark[0]->ID,'bgmp_address');
    	$post_content = $placemark[0]->post_content;
    	//print_r($placemark);
    	//print_r($address);
    	
    	piklist('field', array(
    		'type' => 'text'
    		,'scope' => 'post'
    		,'template' => 'field'
    		,'field' => 'bgmp_address'
    		,'label' => 'Text'
    		,'value' => $address
    		,'attributes' => array(
    		  'class' => 'regular-text'
    		)
    	));
    	
    	piklist('field', array(
    		'type' => 'text'
    		,'scope' => 'post'
    		,'template' => 'field'
    		,'field' => 'post_content'
    		,'label' => 'Text'
    		,'value' => $post_content
    		,'attributes' => array(
    		  'class' => 'regular-text'
    		)
    	));
    
    	piklist('shared/code-locater', array(
    		'location' => __FILE__
    		,'type' => 'Meta Box'
    	));

    I’m attaching a screenshot of the Placemark on the User Profile Tab

    Attachments:
    You must be logged in to view attached files.
    in reply to: Custom Post Type in a Piklist workflow tab #2465
    norboo
    Member

    The User is the Placemark’s author.
    Each User has permission to create/edit only one Placemark. I used another plugin for this and works perfectly.

    in reply to: Custom Post Type in a Piklist workflow tab #2461
    norboo
    Member

    Hi!
    Sorry, I’m amazed how unclear I was in my first post.
    Actually I want to edit CPT bgmp (Placemarks) in a User Profile workflow tab, and not in the normal editor.
    I attached a couple of screenshots, hopefully will make more sense.

    Attachments:
    You must be logged in to view attached files.
    in reply to: User Taxonomy in Admin column #2435
    norboo
    Member

    Thanks Steve!
    Works like a charm!

    in reply to: User Taxonomy in Admin column #2426
    norboo
    Member

    Anyone?

    in reply to: Image File fields for User profile #1781
    norboo
    Member

    Sorry, I didn’t see that somebody else asked a similar question just a while ago.

    Placing them in separate boxes still didn’t work for me. Maybe my situation is a bit more complex because I want to use both images inside a Workflow Tab on User profile. I added each image in a different Tab and now it works even though it’s not ideal solution. I’d still prefer to have both images in the same Tab.

    in reply to: Grouping User taxonomies #1780
    norboo
    Member

    Thanks Steve!
    Exactly what I needed!

    Amazing plugin and…amazing people!

Viewing 8 posts - 1 through 8 (of 8 total)