Support

Account

Home Forums Search Search Results for 'q'

Search Results for 'q'

reply

  • Even more info!

    1. When the Library for the file is set to “Uploaded to post” the front-end form fails at line 50 of file.js: this.o.query.uploadedTo = acf.o.post_id; with the error Uncaught TypeError: Cannot read property 'post_id' of undefined | input.php:812
    2. When the Library is set to “All” that error is avoided but there is another error that occurs in file.js on line 138 title : acf.l10n.file.select, with the error Uncaught TypeError: Cannot read property 'file' of undefined | input.php: 900

    I’m not sure where to go from here

  • Currently the image and file fields have an option for the lobrary to be restricted to ‘uploaded to’.

    This will soon be added to the gallery field.

    P.S. May I ask why you did not set this topic as a question, but as a post?
    It sounds like a question to me

  • Hi @darkwoods

    I don’t understand the requirements of your data setup. How doe sub category relate to the categories?

    Perhaps you could use nested repeater fields? Each category can have a repeater for a sub category.

  • A few tips:

    In the future, if your topic is a question, please do not mark it as a post. Can you please edit this topic and set it as a question so it can be marked solved once complete.

    I would use the get_posts function which accepts the WP_Query args to find the posts. There are args that allow you to search for custom field values. There is even documentation on the ACF site that talks you through how to query posts based on custom field values.

    On that note, did you not search before posting this question?

  • Will I add a function to allow you to search a repeater field for a specific row value?

    No, this is a bit out of scope for the ACF plugin

    Does this solve your question?

  • Btw square brackets are the new in php5.4 for short notation of array(). If you are using <5.4 then use array().

  • i was able to figure it out. For anyone else wondering…

    
    // To get field groups:
    $fieldgroups = apply_filters('acf/get_field_groups');
    
    // To get rules: 
    $location = apply_filters('acf/field_group/get_location', [], $fieldgroup['id']);
    
    // To get fields of group:
    $groupFields = apply_filters('acf/field_group/get_fields', [], $fieldgroup['id']);
    
  • Values.

    I have a spreadsheet with posts and additional fields (custom fields). I want to import this into WP. Not seeing how to do that.

    Zach

  • I think I have miss0understood your original question due to the language barrier.

    Are you asking how to export / import custom field objects?
    Or are you asking hoe to export / import custom field values?

  • I checked out the dump from the custom fields export. It looks like it stores all the data from the actual value as a PHP serialization. This creates a problem for what I’m trying to do. I need to bulk import from a csv a custom post type that has custom fields. I’m using your custom fields plugin for the fields. I have plugin that used to import fields with your plugin. It seems like the code has been deprecated since then.

    In PHP, how would I get all the fields of a field group along with the rules? Your documentation is very clear on how to do that.

  • Before to buy this add-on, have some questions.

    1. Does the plugin custom fields supports shortcodes?
    2. Can i import custom fields data using bulk import?

    Kindly reply

    with regards
    Selvam.S

  • WP has an export / import tool built in. You can access this via Tools -> Import

    You can export ACF to this .xml format via Custom Fields->Export.

    You will also find instructions on that page

  • What is the default format i can use for the WP import?

  • Yes via code. I’m using a plugin from another vendor that needs to be updated.

    Zach

  • Hi,

    How to either import posts with the custom fields?
    ACF uses a post type and custom field metadata to save all the custom field objects.

    This means you can use the export feature in ACF to obtain a .xml file which you can import into a WP install via the default WP import tool!

    Or how to get all fields of a field group?
    Are you asking how via code?

  • Elliot –
    Here is the full section of code.

    <?php if(get_field('pro_perf')) { 
    	   while(has_sub_field('pro_perf')) {
    	        $date_id = 1;
    	        echo '<p> ' . get_sub_field('pro_perf_date') . '<br /> ';
    		if(get_sub_field('pro_perf_time_repeat')) {
    	        	while(has_sub_field('pro_perf_time_repeat')) {
    			    if($date_id <= 1 ) {
                                   $date_tags = get_sub_field('pro_perf_time_tag');
    			       if($date_tags) {
                                    foreach($date_tags as $date_tag) {
    	$t_data = get_option("event_tag_$date_tag->term_id_term_color");
    	echo $t_data;
    echo '<span class="tagbox" style="background:' . $color . ';">' . $date_tag->slug . '</span>';
    				}
    																			
    echo '<a class="date" href="' . get_sub_field('pro_perf_time_link') . '">' . get_sub_field('pro_perf_time') . '</a>';
    
    				} else {
    
     echo '<a class="date" href="' . get_sub_field('pro_perf_time_link') . '">' . get_sub_field('pro_perf_time') . '</a>';
    				}
    
    			} else {
    
    									$date_tags = get_sub_field('pro_perf_time_tag');
                                   if($date_tags) {
                                           foreach($datetags as $datetag) {
    									      echo '<span class="tagbox"> ' . $date_tag->slug . ' </span>';
                                           }
    									
    echo ' | <a class="date" href="' . get_sub_field('pro_perf_time_link') . '">' . get_sub_field('pro_perf_time') . '</a>';
    				} else {
    echo ' | <a class="date" href="' . get_sub_field('pro_perf_time_link') . '">' . get_sub_field('pro_perf_time') . '</a>';
    			        }
         			}
    			$date_id ++;
    		}
    	}
    
    	echo '</p>';
    }
    }?>
    

    Also, to answer your other questions, in my rushed state to post, I did not see the code button as an option. I am also fairly new to forums like this and the truth is it was just laziness and frustration but in the future I will make sure to properly address those issues and be a better community member.

  • Hi,

    You have 2 options:

    1. Use jQuery to find the prev / next data from the DOM and generate the HTML on page load

    or

    2. Don’t use the has_sub_field while loop, instead use a more basic PHP foreach of for loop so you can use the ‘index’ to find the prev (index-1) and next (index+1) rows

    Does that help?

  • Also, as this is the new support forum (currently in beta) I have a few questions for you if you don’t mind:

    1. Why did you not place your code within code tags as seen in the wysiwyg editor?
    2. Why did you not place the topic in the ‘General’ category when it would be better placed in ‘Repeater field’ or ‘Front end’?
    3. Why did you not enter any tags for the topic for users to search for in the future?

    Thanks

forum

Viewing 20 results - 21,326 through 21,345 (of 21,345 total)