WordPress.org

Plugin Directory

Changeset 1475149


Ignore:
Timestamp:
08/16/16 05:22:57 (13 months ago)
Author:
cyrilbatillat
Message:

Trying to correct bad code typo in readme

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quick-and-easy-post-creation-for-acf-relationship-fields/trunk/readme.txt

    r1475147 r1475149  
    7070You can use these URL params to pre-populate an ACF field on your child post. Example: 
    7171 
    72 > <?php 
    73 > add_filter('acf/load_field/name=${NAME_OF_YOUR_ACF_FIELD}', 'populate_acf_field' ); 
    74 > function populate_acf_field( $field ) { 
    75 >     if( !empty( $_REQUEST['acf_rc_from_content_type'] ) && $_REQUEST['acf_rc_from_content_type'] == '${YOUR_PARENT_CONTENT_TYPE}' && !empty( $_REQUEST['acf_rc_from_content_ID'] ) ) { 
    76 >         $field['value'] = 'whatever you want'; 
    77 >     } 
    78 >     return $field; 
    79 > } 
     72    <?php 
     73    add_filter('acf/load_field/name=${NAME_OF_YOUR_ACF_FIELD}', 'populate_acf_field' ); 
     74    function populate_acf_field( $field ) { 
     75        if( !empty( $_REQUEST['acf_rc_from_content_type'] ) && $_REQUEST['acf_rc_from_content_type'] == '${YOUR_PARENT_CONTENT_TYPE}' && !empty( $_REQUEST['acf_rc_from_content_ID'] ) ) { 
     76            $field['value'] = 'whatever you want'; 
     77        } 
     78        return $field; 
     79    } 
    8080 
    8181 
Note: See TracChangeset for help on using the changeset viewer.