Forum Replies Created

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • in reply to: Custom post title #6076
    irene
    Member

    @jrcreative
    Thanks! Fixed!

    in reply to: Custom post title #6069
    irene
    Member

    To make things clearer:

    wordpress version:4.4.2
    piklist version: 0.9.9.7

    code used for empty post title:

    add_filter('piklist_empty_post_title', 'my_new_title', 10, 2);
      function my_new_title($data, $post_array)
      {
    
        // Grab the new title from the custom field. Replace my_custom_field with your own
        $new_title = $post_array['_post_meta']['naam'][0];
    	
    print_r($post_array); // output
        die();
    	
    
        // Only filter on your custom post type. Replace my_custom_cpt with your own.
        return $post_array['post_type'] == 'hond' ? $new_title : $post_array['post_title'];
      }	

    output print:

    Array ( [post_author] => 1 [post_content] => [post_content_filtered] => [post_title] => Auto Draft [post_excerpt] => [post_status] => publish [post_type] => hond [comment_status] => closed [ping_status] => closed [post_password] => [to_ping] => [pinged] => [post_parent] => 0 [menu_order] => 0 [guid] => http://localhost:8888/hondenfokker/?post_type=hond&p=233 [import_id] => 0 [context] => [ID] => 233 [post_date] => 2016-03-13 17:54:56 [post_date_gmt] => [post_name] => [post_modified] => 2016-03-13 17:54:48 [post_modified_gmt] => 0000-00-00 00:00:00 [post_mime_type] => [comment_count] => 0 [ancestors] => Array ( ) [post_category] => Array ( ) [tags_input] => Array ( ) [_wpnonce] => 65f52159f6 [_wp_http_referer] => /hondenfokker/wp-admin/post-new.php?post_type=hond [user_ID] => 1 [action] => editpost [originalaction] => editpost [original_post_status] => auto-draft [referredby] => http://localhost:8888/hondenfokker/wp-admin/edit.php?post_type=hond [_wp_original_http_referer] => http://localhost:8888/hondenfokker/wp-admin/edit.php?post_type=hond [auto_draft] => 1 [post_ID] => 233 [meta-box-order-nonce] => ee13cd8f16 [closedpostboxesnonce] => 627b98b7c3 [hidden_post_status] => draft [original_publish] => Publish [publish] => Publish [_post_meta] => Array ( [naam] => bewaar [geslacht] => Array ( [0] => sex-reu ) [eigenaar] => Array ( [0] => eigendom2 ) ) [_] => Array ( [nonce] => 2b8e9ffd3a [fields] => 4d05fee34f87a1ab00a10073f69538bb ) [filter] => db )

    Last time I did not ask you why this was happening, you told what but not the why. I need to understand the why.

    in reply to: Possible to use field-relate as select in an add-more #5873
    irene
    Member

    Excuse me for bothering you again…
    Trying to get the following:
    I would like to render the selected post on the post edit page and used the following

    /*
    Title: Nest Informatie
    Post Type: nesten
    Status: auto-draft
    Collapse: false
    Meta box: false
    */
    
    piklist('field', array(
    	'type' => 'group'
       ,'template' => 'field'
      
       ,'fields' => array(
        
    	
    	array(
      'type' => 'select'
      ,'field' => 'sire'
      ,'label' => 'Sire:'
      ,'columns' => 6
      ,'choices' => piklist(
      					get_posts(
    					   array(
      	    'sort_order' => 'ASC'
    	   ,'post_type' => 'hond'
    	   ,'post_status' => 'publish'
    	   ,'tax_query' => array(
    		array(
    			'taxonomy' => 'geslacht'
    			,'field'   => 'slug'
    			,'terms'   => 'reu'  ))
        )
    	 ,'objects'
    	)
    	
    	
    	,array(
          'ID'
          ,'post_title')
      
      ) )

    and the following on the next page:

    /*
    Title: edit nesten
    Post Type: nesten
    Status: publish
    Collapse: false
    Meta box: false
    */
    ?>
    <?php $value_sire=get_post_meta(get_the_ID(), 'sire', true);
    			$sire_post_id= $value_sire['ID'];
    			$sire_permalink= get_permalink($sire_post_id);
    			$sire_name= get_post_meta($sire_post_id, 'sire',true);
    			?>
                
                <ul>
                <li> <a href=" <?php echo $sire_permalink; ?>" <?php echo $sire_name; ?></a></li>
                </ul>

    Both nothing shows up on the second page… I am missing something…

    Have been reading this post select-box-for-displaying-posts but can not figure it out…

    in reply to: Possible to use field-relate as select in an add-more #5842
    irene
    Member

    Hello Steve,
    Maybe I could use that…
    Thinking and re-thinking…
    Hope I can explain…
    I have 2 cpt’s
    1. Dogs
    2. Litters
    In the Dogs CPT all dogs are entered (bitches, dogs and pups with category male ore female
    In the Litters cpt, create a new litter => Choose dam, from dogs-cpt, category female
    Choose sire, from dogs-cpt, category male
    These 2 form the parents.
    Then below that the pups (children, need to be related to dam and sire, and are siblings. These pups are also coming from Dogs cpt- resp, female or male….

    I can not find anywhere if when I use an add more the items chosen are directly related to the post.
    New to all this but willing to learn 🙂
    Hope you can follow me and if you can advise me on how to achieve this…

    Thanks,
    Irene

    in reply to: empty post title does not replace all of the title… #5748
    irene
    Member

    Hello Steve,
    Fixed it!!!
    I messed up my folder structure :$
    Thanks for al your time!

    Have a nice evening,
    greetings Irene

    in reply to: empty post title does not replace all of the title… #5742
    irene
    Member

    Hi Steve,
    Thanks for all the trouble you took to help me out but[‘geregistreerde_naam’], is just what I used… So that can not be it. I have tried to change the name of the custom field but that did not help. I am going to reconstruct everything from base and maybe I will then find out what I did change/misspelled…
    I will let you know what I found if you would like so…
    Thanks,
    Irene

    in reply to: empty post title does not replace all of the title… #5738
    irene
    Member

    I am so sorry I do not see what is wrong or which value I do need 🙁
    Maybe you can direct me so I can understand where I should look for, also handy for the future…

    The output is as follow:

    Array ( [post_author] => 1 [post_content] => [post_content_filtered] => [post_title] => Automatische concepten [post_excerpt] =>[post_status] => publish [post_type] => dog [comment_status] => closed [ping_status] => closed [post_password] => [to_ping] =>[pinged] => [post_parent] => 0 [menu_order] => 0 [guid] => http://localhost:8888/fokker2/?post_type=dog&p=431 [import_id] => 0[context] => [ID] => 431 [post_date] => 2016-01-25 20:18:13 [post_date_gmt] => [post_name] => [post_modified] => 2016-01-25 20:18:03[post_modified_gmt] => 0000-00-00 00:00:00 [post_mime_type] => [comment_count] => 0 [ancestors] => Array ( ) [post_category]=> Array ( ) [tags_input] => Array ( ) [_wpnonce] => 9133725c53 [_wp_http_referer] => /fokker2/wp-admin/post-new.php?post_type=dog[user_ID] => 1 [action] => editpost [originalaction] => editpost [original_post_status] => auto-draft[referredby] => http://localhost:8888/fokker2/wp-admin/edit.php?post_type=dog [_wp_original_http_referer] => http://localhost:8888/fokker2/wp-admin edit.php?post_type=dog [auto_draft] => 1 [post_ID] => 431 [meta-box-order-nonce] => eed8522ce1 [closedpostboxesnonce] => f05b01e313[hidden_post_status] => draft [original_publish] => Publiceren [publish] => Publiceren [_post_meta] => Array ([geregistreerde_naam] => Missy [male] => Array ( [0] => option2 ) ) [_] => Array ( [nonce] => 711408066e [fields] =>bd8b22853016e1a07d301ef541ad2a8a ) [filter] => db )

    in reply to: empty post title does not replace all of the title… #5733
    irene
    Member

    I get just the first letter of the word!

    in reply to: empty post title does not replace all of the title… #5730
    irene
    Member

    Hi Steve,
    I am on a localhost, do not know if this influences anything, but if I put in the line of code you give me I get a blanc screen…
    (Hope I am doing things the way I should…)

    irene
    Member

    Steve: 🙂
    Thank you!!!!!
    Got it! Now figure out the rest 🙂

    Irene

    irene
    Member

    Hello Steve,
    Thanks for answering my question.
    I have downloaded the new beta and have read and looked at the code, but, maybe I have overlooked it or just because I am new to developing, I can not find a piece of code where I can refer to my custom post type on a blanc Admin page.
    If I place a form on the blanc admin page how can I then save the data to the correct custom post type (dog in my case), or is it not necessary to save to a particular post type to be able to make for example a profile page…, and relations (parent, children…)

    irene
    Member

    Hallo Steve,
    What I would like to do is:
    Create a custom post type with show_ui => false with piklist (have already done that), create a new admin page (blanco) with menu on top level and create a custom edit post page for this cpt.
    I would like to have the user post layout, tried using the user post at first but I just want to input dog names, b-day etc… for later use, no need for log-in, password, e-mail etc…

    Recapitulating:

    Is there is a way where i can create my own edit.php page from scratch for my custom post type with the use of Piklist?
    I Understand I need to create a cpt and set show_ui to false and construct an interface for the CPT just as for an plugin admin page. But I do not understand how I can than refer to the cpt inside this admin page, make the metaboxes and workflow’s appear on this new admin page and save the meta data to the cpt….

    Very Grateful if you could help me…

    Irene

    in reply to: hide "add new" on edit.php #3811
    irene
    Member

    I am truly shocked!!! 🙂
    Thanks Steve, should have thought of that one…

    in reply to: New attribute metabox #3786
    irene
    Member

    Hello Steve!
    Thanks! It works…
    Irene

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