Support

Account

Home Forums Search Search Results for 'q'

Search Results for 'q'

topic

  • Unread

    ACF pro & wild apricot restricted content

    Hi to all,
    I’ve a question about wild apricot and ACF PRO field’s integration with wordpress.
    Wild apricot have a short code that restrict a content for some user level :

    [wa_restricted roles="Gold, Silver" login_label="Log in" message="Log on to view restricted content."]
    Restricted content
    [/wa_restricted]

    how i do to insert shortcode after and before ACF field to restrict that?

    thank you
    Andrea

  • Unread

    Validate FC field to be unique (within page)

    I’m using Flexible Content (FC) as part of a page template; each “section” of the page is built using a FC field; within the FC is a “section ID” field, which needs to be unique within the page itself.

    I’ve found different solutions for validating fields against each other on the same page (via $_POST[‘acf’]), but I’ve not come across a situation where there has been done when using Flexible Content. I have it partially working; it finds duplicates of the field and alerts the user that the field needs to be unique, but the problem I’m having is that it’s marking all of the fields of the field type that needs to be unique, whether or not it’s the field with the duplicate ID.

    For example, I have a repeater field (key = field_1234) and within that repeater I have a text field for a unique section ID input (key = field_5678). When I use the following code…

    function validate_unique_id( $valid, $value, $field, $input_name ) {
      foreach ($_POST['acf']['field_1234'] as $row) {
        if (in_array($row['field_5678'], $list)) {
            $valid = 'There are duplicate '.$field['name'].' values';
            break;
        }
        $list[] = $row['field_5678'];
      }
      return $valid;
    }
    add_filter('acf/validate_value/key=field_5678', 'validate_unique_id', 10, 4);

    …and a user creates three sections, with two of those sections using the same section ID in the text field (key = field_5678)…in this case, because there are duplicates, it halts the save and alerts the user to the validation error, but instead of just highlighting the fields that contain the duplicate values, it highlights all of the section ID fields, even if they’re unique. Is there any way to modify the above code so that it only highlights the fields that contain duplicate IDs?

    Any advice would be appreciated.

  • Unread

    Trying to hide container div when fields within it have no value

    I am trying to hide a container div if the fields within it have no value. The fields themselves aren’t a problem. If they have no value they aren’t displayed. But if I add padding to the container div it shows up on the page. How can I hide it completely?

    Div still shows when padding is added

    Here’s my code –
    <div class=”transform-txt-block-1″ style=”background-color:aquamarine”>
    <?php if($block[‘title’]){
    echo ‘<h4 class=”h5″>’.$block[‘title’].'</h4>’;
    }
    if($block[‘short_description’]){
    echo $block[‘short_description’];
    } ?>
    </div>
    <div class=”transform-txt-block-2″ style=”background-color:bisque”>
    <?php if($block[‘title_2’]){
    echo ‘<h4 class=”h5″>’.$block[‘title_2′].'</h4>’;
    }
    if($block[‘short_description_2’]){
    echo $block[‘short_description_2’];
    } ?>
    </div>

  • Unread

    Fields groups missing from backend on WooCommerce products

    Hi,

    I’m maintaining a WooCommerce site for a client who had a different developer set things up originally. Currently running WordPress version 6.6.2, WooCommerce version 9.3.3, and ACF Pro version 6.3.10. The previous developer set up a field group to provide some additional filtering options for products in certain categories (custom taxonomies). This worked fine for quite some time, but at some point, this field group stopped showing up on the backend when creating or editing products.
    For the field group, the location rules were set to show these fields when “post type = product”, and “post taxonomy = specified category”. If I remove the “post type = product” criteria, the fields show up.

    I have no idea why the previous dev set both these criteria, and I *could* simply remove the “post type = product” rule from the location rules, but I’d rather find out what went wrong to cause this to stop working.Any tips on where to start would be greatly appreciated.

    thanks!

  • Solved

    ACF Block Duplication – Content Disappears

    So, a weird issue. I am creating a custom theme using custom ACF Blocks. Everything works great except when I try to duplicate a block in the admin to have a similar block on the page.

    After duplication, I hit save and it shows up exactly as the original block. When I try to adjust any of the content and hit save, it clears out all content from all fields within the duplicated block leaving them blank. I Try adding content again, it doesn’t save, just stays blank.

    It works fine if I add a new block of the same type and just copy the content over, but the duplication process just doesn’t work.

    Things I checked.
    Both blocks have unique IDs
    No console errors
    error log not showing anything related
    WP Debug on and not showing anything
    Cleared all caching

    Also this is using WP Multi-site (Not sure if that matters)

    Any help greatly appreciated.

  • Solved

    Display 2 seperate forms depending on query result

    Hi, im absolutely loving ACF, and after 2 days of messing around trying to get the post title to update, ive sussed it and have to move the form head into my AVADA header.php file thatI copied to the child theme.

    All is updating correctly now.

    Im currently trying to display a form to a user that ID matched the author ID of a single post pulled…

    Then, if no ID matches author ID, display the acf form to create a new post.
    (Driver Profiles)

    Form displays for matching ID perfectly, but the new post form only displays the title (which im fine with) but does not create the post when submitted.

    <?php
    $args = array(
    	'post_type' 		=> 		'driver',
    	'author'        	=>  	$current_user->ID,
    	'orderby'       	=>  	'post_date',
    	'order'         	=>  	'ASC',
    	'posts_per_page' 	=> 		1
    );
    $post_query = new WP_Query($args);
    if($post_query->have_posts() ) {
    	while($post_query->have_posts() ) {
    		$post_query->the_post();
    		echo('We Found A Profile!'); // Debug
    		acf_form(array(
    		'post_id'       => get_the_ID(),
            'post_title'    => true,
            'post_content'  => false,
    		'uploader' => 'basic',
            'submit_value'  => __('Update Profile'),
    		'updated_message' => __("Profile updated", 'acf')
    		));
    	}
    } else {
    	echo ('No Profile Found, Please Create Your Profile Below'); // Debug
    	acf_form(array(
    		'post_id'       => 'new_post',
            'post_title'    => true,
            'post_content'  => false,
    		'uploader' => 'basic',
            'submit_value'  => __('Create Profile'),
    		'updated_message' => __("Profile Created", 'acf')
    		));
    };

    Could anyone spot any issue in my code at all?

  • Unread

    Sorting archive results using an ACF taxonomy

    I’ve an interesting challenge (can’t be a problem, it has to be possible to solve it).

    I’m trying to sort an archive page on title, using an ACF taxonomy.

    I tried it with the following code snippet:

    
    add_action( 'pre_get_posts', 'new_sort_order'); 
    function new_sort_order($query){
       global $wp_query;
    	if (is_archive() && is_post_type_archive('card') ):
    		//Set the order ASC or DESC
    		$query->set( 'order', 'ASC' );
    		//Set the orderby
    		$query->set( 'orderby', 'title' );
    	endif;    
    };
    

    ‘card’ is also an ACF post type.

    It does not work. When I remove the ‘is_post_type_archive’ it does, but then it sorts every archive page of every post type on title. That’s not the idea.

    So I delved a bit deeper into the query, and I see the ‘is_post_type_archive’ function checks against the ‘post_type’ field of the global $wp_query, and the value of that field is ‘acf-taxonomy’.

    So is there a way to retrieve the post_type value (‘cards’) from the query?

    Thanks in advance
    Wilko

  • Unread

    ACF Date Sort

    Hello!

    Kind of a complicated question here. I have a custom post type that has posts created programatically when a new item is created in SoundCloud. These posts have ACF fields – among them is an event_date field that is a datepicker. All is working perfectly with the post creation. The issue is that I display those posts on the front end of my website and they are sorted in DESC order on the event_date field. However the posts appear out of order when they are first created. If I open up the post in the WP Admin and then save them (without changing anything) then they will be correctly sorted. Its like that field has to be re-initialized after the post is created programatically with a manual save. Any ideas how to resolve the issue without going into each post? I did build a cron that ran wp_udpate_post on each post with just the post ID as an argument, but it didn’t resolve the issue.

    Thanks!

  • Unread

    get_field in an ACF block template vs. Flex Content

    I am wondering if ACF Blocks are more performant from the standpoint of database calls in my example below, with respect to the get_field function call.

    I have made a custom ACF block with a text field “headline” – in the block PHP file I am using get_field(“headline”) and then echoing the result. I also can see from var_export that there is an array called $block which has a key “data” that is itself an array of the ACF fields – i.e. I could also be echoing $block[“data”][“headline”] and not run get_field at all.

    First question – is there any difference in the above 2 methods – either get_field or getting the value out of the $block array?

    Second question – when using ACF blocks, is get_field in a block PHP template actually querying the database, or is it parsing the result of a query that has already happened in the PHP execution? In this way, is a page with multiple ACF blocks not adding any more database queries because the values of every field on every block was returned from the post_content column in the wp_posts table? Does this make blocks strictly more performant from a DB querying perspective than flexible content layouts?

    Thanks for any isnights

  • Unread

    acf/init not triggring

    Hello,
    I have a strange problem that I can’t solve. It has the following simplified structure.

    
        function getPageLanguage() {
            // get_Language
            $getPageLanguageOption = get_field('wkdm_language_settings_current_language', 'option');
            $returnLanguag = "";
    
            if ($getPageLanguageOption == "") {
                $returnLanguag = "de"; // Standard-Sprache auf "de" setzen
            } else {
                $returnLanguag = $getPageLanguageOption;
            }
    
            return $returnLanguag;
        }
    

    this is in a PHP file I have in functions.phopdirectly as the first include.
    After that I include another file there I have

    
    $languageTest = getPageLanguage();
    if(getPageType() == "WKDM" && $languageTest == "de" ){
    }
    add_action("acf/init", "my_acf_init_test");
    function my_acf_init_test() {
    // not triggering
    }
    

    But if I remove the query on $languageTest in the first if query, acf/init is triggered.
    The same applies if I remove the get field from the getPageLanguage() function and set a language directly.
    But I do not get an error message. The return from the function is also correct.

    ACF Init also triggering if i put it before the if statement

    Im Using ACF pro Version 6.3.6

  • Solving

    Empty data in Gutenberg block (“data”:{})

    Hello. We have a bug when working with Gutenberg sides with ACF fields.

    WordPress: 6.5.5
    Apache: 2.4.61
    PHP: 8.1.29
    Advanced Custom Fields PRO: 6.3.9

    Gutenberg blocks are registered via block.json and register_block_type. Fields for the block are added via ACF.

    The problem:
    Sometimes when I add a block in the editor, the data for it does not load.
    This is what a block added for the first time should look like:
    <!– wp:vp-swan/gallery {“name”:”vp-swan/gallery”,”data”:{“field_66f28000f6c68″:””,”field_66c196c31255b”:”1″,”field_66bcecc968768″:{“row-0”:{“field_66bcecdf68769″:””,”field_66bcecec6876a”:””}}},”mode”:”edit”} /–>

    But very often the block is added like this:
    <!– wp:vp-swan/gallery {“name”:”vp-swan/gallery”,”data”:{},”mode”:”edit”} /–>

    The most interesting thing is that the block in the visual editor looks normal, and I can add data there. But after saving, the data is not saved and is lost.

    I also noticed that this happens because when adding a block, there is no request to admin-ajax.php with action:acf/ajax/fetch-block, which is probably why the data is not loaded.

  • Unread

    ACF Pro Field Group – await save – Issue

    Hello,
    issue awaiting save
    I have a problem with an ACF Pro file.
    The changes are available, but the JSON is not saved (see screenshot).
    I am now looking for the error, but have not found the right answer on Google.
    Therefore my general questions first:
    1. does the name have to be unique in the entire field group? There are definitely duplicate names. Could this be a possible cause?
    Write permissions are available in the folder on the server.

    WP: Current version: 6.6.2
    PHP: 8.1.7
    ACF Pro: 5.9.0

  • Unread

    Reusing Flexible Content / Page Builder-esque Functionality

    Is it possible to create Flexible Content rows that can be saved in a global fashion which could be reused throughout the site? Ideally, it would be possible to edit the content of these global Flexible Content rows and have those changes appear throughout the site wherever they are used.

  • Solved

    Set relationship field value on new post

    Hello, I have an Address post_type that is connected to Post using a relationship field. I wonder if it’s possible to pre-select the address in the relationship field when I create a new Post. The id of the address would come through a query param (not sure if there’s a better way but this allows us to create simple links from another system). I only need a single Address to be associated to the post.

    I tried with acf/load_value but that didn’t work. I can see the function is called and the $post_id and $field are correct, but returning an array doesn’t seem to populate the field in the form. Here’s the code:

    function setAddress($value, $post_id, $field) {
        $addressId = $_GET['address_id'] ?? false;
        if ($addressId) {
            return [$addressId];
        }
        return $value;
    }
    
    add_filter('acf/load_value/name=address', 'setAddress', 10, 3);

    Is this something that can be done in a new post or does it only work when updating existing posts?
    The return format I selected is Post Object. If I try to return an array of post objects (return [get_post($addressId)];) the ACF field doesn’t show up so that doesn’t seem to be it.

    Maybe there’s an alternative way I’m not aware of?

  • Unread

    ACF defined Post Type and Taxonomy metabox callbacks stopped access to $_POST

    Hello team,
    My employer company is using ACF Pro on number of websites for a long time. However, in the present situation, a few confusions have popped up regarding the plugin.

    In the majority of cases, we do not use ACF to create a custom post type or a custom taxonomy. As the title says (according to you), CPTs or taxonomies created using ACF, $_POST array will no longer be accessible in the callback methods.

    My question is: what happens with the existing field groups and custom fields that are created for different post types/taxonomies, even though none of them are created using ACF?

    Is there any known caveat related to the above, that might come up after updating the plugin?

    Also, since we are using a Pro license, we should be able to continue to download updates directly from ACF server, correct?

    Best,
    Subrata Sarkar

  • Unread

    JSON Question

    I have always configured ACF in the interface but I am looking after a site which uses the JSON files for ACF setup. The field groups can be imported and I can see their setup but I am guessing the content types have been setup using JSON but I cant see the config for those – is there any way I can force them to appear in the GUI so i dont have to dig through the json files to see their setup?

  • Unread

    Fetch field dynamically

    Hello,

    I have a custom post type, with a custom taxonomy (services). I need to assign a price to each service, that is unique, per post.

    I created a group on the post type, where the field names match the names of the taxonomy term that I would like to display them next to.

    Then on the front end I am trying list the services, with their unique price.

    I have tried doing this, but I get ‘Warning: Undefined array key’

    <?php
      $prices = get_field('service_prices');
      $service_name = strtolower(str_replace(' ', '_', $service->name));
    if ($prices):
    ?>
    	<div>
    		<?= $prices[$service_name]; ?>
    	</div>
    <?php endif; ?>

    How would I successfully go about doing something like this? My $service_name is outputting the correct ACF field name.

  • Unread

    Fetch ACF field dynamically

    Hello,

    I have a custom post type, with a custom taxonomy (services). I need to assign a price to each service, that is unique, per post.

    I created a group on the post type, where the field names match the names of the taxonomy term that I would like to display them next to.

    Then on the front end I am trying list the services, with their unique price.

    I have tried doing this, but I get ‘Warning: Undefined array key’

    <?php
      $prices = get_field('service_prices');
      $service_name = strtolower(str_replace(' ', '_', $service->name));
    if ($prices):
    ?>
    	<div>
    		<?= $prices[$service_name]; ?>
    	</div>
    <?php endif; ?>

    How would I successfully go about doing something like this? My $service_name is outputting the correct ACF field name.

  • Solved

    Calling get_field on a repeater field doesn’t get all rows

    Hi,

    I’m populating choices from a repeater field like this example from the docs. However, I’m struggling to get all of the rows when the repeater is using pagination.

    For my page template, I got 2 field groups. One is containing the select field in question, the other is containing some other settings. The select field is getting all of the rows from the repeater field if the field group / meta box that it belongs to is located at the top of the list of field groups. When placed at the bottom it’s only being populated with the number of rows that’s defined in the rows_per_page setting for the repeater (4 in this case). I’ve attached 2 images to visualize this.

    I looked in the ACF code and found that in class-acf-field-repeater.php there is some checks for where the setting is rendered and it disables pagination if needed. Excluding my field from pagination here does solve the issue.

    Has anyone else experienced this issue or is able to replicate it? During debugging I’ve disabled all other plugins and use the twenty twenty three theme, still the issue remains. Running Acf pro 6.1.6 on WP 6.2.1 for my sites but have tried the latest versions of both acf and WP to no avail.

    Any pointers or ideas would be much appreciated.

  • Unread

    Targeting within graphQL

    I have a problem with filtering posts by categories (field type: taxonomy), how can I target category/name? I attached the screens from graphQL discord where I first posted this question but they send me to “graphQL scheme creator”, please help !

  • Unread

    Update sub_field via JS

    I am trying to update a True/False subfield from a Repeater Field on an option page when a CF7 form has been sent.

    CF7 JS code:

    <script type="text/javascript">
        document.addEventListener( 'wpcf7mailsent', function( event ) {
            .....
        }, false );
    </script>

    PHP working code:

    <?php update_sub_field( array('repeater_field', 1, 'true_false_subfield'), 'yes', option );?>
    

    I’ve looked at https://www.advancedcustomfields.com/resources/javascript-api/, but I can’t find a way to do it.

    Any ideas?

    Thanks!

  • Unread

    Getting values into add_theme_support()

    oops, I got my question marked as spam when I added html.
    Trying again:

    I have created an options page with a color picker. I am attempting to call the colors in functions.php in add_theme_support. The values from the options aren’t loading though. Is it too early? Any thoughts? Here’s my code:

    
    $bdn_color_palette = array();
    
    $bdn_color_palette[] = array(
    	'name' => 'Primary',
    	'slug' => 'primary',
    	'color' => esc_html( get_field('brand_colour_primary', 'option') ),
    );
    $bdn_color_palette[] = array(
    	'name' => 'Secondary',
    	'slug' => 'secondary',
    	'color' => esc_html( get_field('brand_colour_secondary', 'option') ),
    );
    
    add_theme_support( 'editor-color-palette', $bdn_color_palette );
    
  • Unread

    Including ACF Custom Fields in single.php Template

    I am attempting to include ACF meta fields in the single.php template. I have added a section that includes a table with various meta fields. If I copy all the code including/within the TABLE section directly into the post, it will pull the values using the shortcodes. However, in the template file, it just displays the shortcode code as opposed to the actual values. See coding below…

            if ( in_category('storm-chase-logs') ) { 
            echo '<table class="table2" border="1" width="100%" cellspacing="0" cellpadding="0"><colgroup> <col style="width: 50%;" span="1" /> <col style="width: 50%;" span="1" /></colgroup>
    <tbody>
    <tr>
    <td>
    <table border="0" width="100%"><colgroup> <col style="width: 50%;" span="1" /> <col style="width: 50%;" span="1" /> </colgroup>
    <tbody>
    <tr>
    <td bgcolor="#e5e5e5"><span style="font-size: 12pt;"> <strong>LOG DATE</strong>:</span></td>
    <td bgcolor="#e5e5e5"> <span style="font-size: 12pt;">[xyz-ips snippet="ACF-Log-Date"]</span></td>
    </tr>
    <tr>
    <td> <span style="font-size: 12pt;"><strong>CHASE VEHICLE</strong>:</span></td>
    <td> <span style="font-size: 12pt;">[xyz-ips snippet="ACF-Chase-Vehicle"]</span></td>
    </tr>
    <tr>
    <td bgcolor="#e5e5e5"> <span style="font-size: 12pt;"><strong>CHASE PARTNERS</strong>:</span></td>
    <td bgcolor="#e5e5e5"> <span style="font-size: 12pt;">[xyz-ips snippet="ACF-Chase-Partners"]</span></td>
    </tr>
    <tr>
    <td> <span style="font-size: 12pt;"><strong>TARGET REGION</strong>:</span></td>
    <td> <span style="font-size: 12pt;">[xyz-ips snippet="ACF-Target-Region"]</span></td>
    </tr>
    <tr>
    <td bgcolor="#e5e5e5"> <span style="font-size: 12pt;"><strong>MILES DRIVEN:</strong></span></td>
    <td bgcolor="#e5e5e5"> <span style="font-size: 12pt;">BOO</span></td>
    </tr>
    </tbody>
    </table>
    </td>
    <td>
    <table border="0" width="50%">
    <tbody>
    <tr>
    <td align="center" bgcolor="grey"><strong><span style="font-size: 14pt;">SPC OUTLOOK: [xyz-ips snippet="ACF-SPC-Outlook"]</span></strong>
    <table border="0" width="100%" bgcolor="#e5e5e5"><colgroup> <col style="width: 33%;" span="1" /> <col style="width: 34%;" span="1" /> <col style="width: 33%;" span="1" /></colgroup>
    <tbody>
    <tr>
    <td align="center"><span style="font-size: 12pt;"><strong>TORNADO</strong></span></td>
    <td align="center"><span style="font-size: 12pt;"><strong>HAIL</strong></span></td>
    <td align="center"><span style="font-size: 12pt;"><strong>WIND</strong></span></td>
    </tr>
    <tr>
    <td align="center"><span style="font-size: 12pt;">[xyz-ips snippet="ACF-SPC-Tornado"]</span></td>
    <td align="center"><span style="font-size: 12pt;">[xyz-ips snippet="ACF-SPC-Hail"]</span></td>
    <td align="center"><span style="font-size: 12pt;">[xyz-ips snippet="ACF-SPC-Wind"]</span></td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    <tr>
    <td>
    <table border="0" width="100%"><colgroup> <col style="width: 50%;" span="1" /> <col style="width: 50%;" span="1" /></colgroup>
    <tbody>
    <tr>
    <td><span style="font-size: 12pt;"><strong>TORNADOES SEEN:</strong> [xyz-ips snippet="ACF-Tornado"]<strong>
    </strong></span></td>
    <td><span style="font-size: 12pt;"><strong>FLOODING:</strong> [xyz-ips snippet="ACF-Flooding"]
    </span></td>
    </tr>
    <tr>
    <td><span style="font-size: 12pt;"><strong>HAIL ENCOUNTERED:</strong> [xyz-ips snippet="ACF-Hail"]"</span></td>
    <td><span style="font-size: 12pt;"><strong>DAMAGE:</strong> [xyz-ips snippet="ACF-Damage"]
    </span></td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    </tbody>
    </table>';
             }
        
            // END Chase Log Stats Section

    This is a custom template using the single.php file, so I am attempting to make it so that the ACF fields are pulled into the table. Currently, it is just displaying the shortcode text on the front end. Any assistance would be helpful.

  • Unread

    Send emails multiple recipents

    Hello,

    I am currently trying to configure a Contact Form 7 form to send emails to multiple recipients based on selected WooCommerce products. Each product has an ACF field (of type email) associated with it, and I would like the email to be sent to these addresses based on the selected products in the front end.

    I have implemented the following code in the functions.php file, but it doesn’t seem to work as expected. The email is sent to the recipient specified in the form configuration, but not to the email addresses associated with the selected products.

    Here’s the code I am using:

    // Retrieve email addresses linked to selected products
    add_action('wpcf7_before_send_mail', 'send_to_multiple_recipients');
    function send_to_multiple_recipients($contact_form) {
        if ($contact_form->id() == '1e5363b') {  // Replace with your form ID
            $submission = WPCF7_Submission::get_instance();
            
            if ($submission) {
                $posted_data = $submission->get_posted_data();
                $selected_products = isset($posted_data['product-selection']) ? $posted_data['product-selection'] : array();
    
                $recipients = array();
                foreach ($selected_products as $product_name) {
                    $product = get_page_by_title($product_name, OBJECT, 'product');
                    if ($product) {
                        $product_email = get_field('partnersz1_email', $product->ID);
                        if ($product_email) {
                            $recipients[] = $product_email;
                        }
                    }
                }
    
                if (!empty($recipients)) {
                    $mail = $contact_form->prop('mail');
                    $mail['recipient'] = implode(',', $recipients);
                    $contact_form->set_properties(array('mail' => $mail));
                }
            }
        }
    }
    
    // Automate product options generation
    add_shortcode('product_selection', 'generate_product_selection');
    function generate_product_selection() {
        $products = wc_get_products(array('limit' => -1));
        $output = '<select name="product-selection" multiple>';
        
        foreach ($products as $product) {
            $output .= '<option value="' . $product->get_name() . '">' . $product->get_name() . '</option>';
        }
        
        $output .= '</select>';
        return $output;
    }

    I would appreciate any guidance or suggestions to resolve this issue so that the email can be sent to the selected product addresses as intended.

    Thank you for your assistance!

    Best regards,

  • Solving

    Extending field in JavaScript, can I call the parent method?

    Hello, If I extend an existing field in javascript with

    const ImageExtends = acf.models.ImageField.extend({

    And I wish to create a replacement function, lets say removeAttachment, is there a way to invoke the parent method so I can avoid having to duplicate the original method/functions body? I still want to call the original remove, but do some extra work either side of that call.

    eg the PHP equivalent in a class is parent::someMethod() from within someMethod on child.

    I found that…

    // Set a convenience property in case the parent's prototype is needed later.
    //Child.prototype.__parent__ = Parent.prototype;

    …is commented out, does this elude to this being intentionally disabled?

Viewing 25 results - 101 through 125 (of 21,345 total)