Support

Account

Forum Replies Created

  • That’s incredibly helpful to know. I’ll adopt those practices for this plugin, in that case. ACF has some seriously great features!

  • Yes, I had added that particular field manually on the site. Sorry, I should have specified that previously. But it sounds like that’s not best practice if fields can be generated within the plugin code itself.

    Thank you very much, I’ll start a process of elimination to narrow down which other plugin/theme is causing the issue.

  • This reply has been marked as private.
  • It exists as the sole field within a field group entitled “Do Not Alter: Parent Relationship”. I didn’t even realize you could create fields outside of groups (which it sounds like is something you’re saying is possible). It does not exist in a repeater, clone, or flex field, and is not nested.

    Field Label: Funbotic Parents
    Field Name: funbotic_parents
    Field Type: Text Area
    Required?: No
    Conditional Logic: No

    I appreciate your continued support on this!

  • This is quite strange. I did a search of the entire Local By Flywheel directory where this dev site is currently being worked on, and the only “acf/load_field” or “acf/prepare_field” that weren’t referenced in the actual ACF files were entirely unrelated, and referenced different fields. (And there were very few of them in the first place.) I suppose the investigation will have to continue.

  • Thank you so much, John. I’ll dig into this now and see if I’m able to turn up whatever the possible source of another filter might be.

  • Below are the settings that are listed. I was using var_dump to examine these previously, and didn’t see anything particularly odd, but I’m definitely not the expert on this!

    Array
    (
        [key] => field_5ada292c76da5
        [label] => Funbotic Parents
        [name] => funbotic_parents
        [_name] => funbotic_parents
        [type] => textarea
        [order_no] => 0
        [instructions] => These are the parents currently associated with this user.  To alter the user's parents, go to one of these parents' profiles, or any other Customer (to add a new parent.)
        [required] => 0
        [id] => acf-field-funbotic_parents
        [class] => textarea
        [conditional_logic] => Array
            (
                [status] => 0
                [rules] => Array
                    (
                        [0] => Array
                            (
                                [field] => null
                                [operator] => ==
                            )
    
                    )
    
                [allorany] => all
            )
    
        [default_value] => 
        [placeholder] => 
        [maxlength] => 
        [rows] => 
        [formatting] => br
        [field_group] => 4617
        [readonly] => 1
    )

    For the first test you mentioned, “here” is indeed echoed.

  • Haha on the contrary, you’ve given me a lot to look into! The line for adding the filter sits by itself in the funbotic-parent-child-relationships.php file, but it sounds like what you’re saying is that because the plugin bootstrap is being used, this changes how that file will be loaded, and thus when that filter/action will fire.

    It sounds like I need to have a better understanding of how all those lower level pieces fit together before I’ll be able to effectively troubleshoot this issue. I very much appreciate the time and effort you’ve taken to answer this question!

  • I’m gonna dump the funbotic.php file here – as far as I can tell it’s loaded at whatever priority a standard plugin would be. All the other code I’ve written in the plugin shows up, and I’ve not personally defined the plugin to be loaded only conditionally.

    <?php
    
    /**
     * The plugin bootstrap file
     *
     * This file is read by WordPress to generate the plugin information in the plugin
     * admin area. This file also includes all of the dependencies used by the plugin,
     * registers the activation and deactivation functions, and defines a function
     * that starts the plugin.
     *
     * @link              https://www.funbotic.com
     * @since             1.0.0
     * @package           Funbotic
     *
     * @wordpress-plugin
     * Plugin Name:       Funbotic
     * Plugin URI:        https://www.funbotic.com
     * Description:       Logged in/logged out menu.  Conditional shortcodes.  Custom fields.
     * Version:           1.0.0
     * Author:            Alexander LaBrie
     * Author URI:        https://www.funbotic.com
     * License:           GPL-2.0+
     * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
     * Text Domain:       funbotic
     * Domain Path:       /languages
     */
    
    // If this file is called directly, abort.
    if ( ! defined( 'WPINC' ) ) {
    	die;
    }
    
    /**
     * Currently plugin version.
     * Start at version 1.0.0 and use SemVer - https://semver.org
     * Rename this for your plugin and update it as you release new versions.
     */
    define( 'PLUGIN_NAME_VERSION', '1.0.0' );
    
    /**
     * The code that runs during plugin activation.
     * This action is documented in includes/class-funbotic-activator.php
     */
    function activate_funbotic() {
    	require_once plugin_dir_path( __FILE__ ) . 'includes/class-funbotic-activator.php';
    	Funbotic_Activator::activate();
    }
    
    /**
     * The code that runs during plugin deactivation.
     * This action is documented in includes/class-funbotic-deactivator.php
     */
    function deactivate_funbotic() {
    	require_once plugin_dir_path( __FILE__ ) . 'includes/class-funbotic-deactivator.php';
    	Funbotic_Deactivator::deactivate();
    }
    
    register_activation_hook( __FILE__, 'activate_funbotic' );
    register_deactivation_hook( __FILE__, 'deactivate_funbotic' );
    
    /**
     * The core plugin class that is used to define internationalization,
     * admin-specific hooks, and public-facing site hooks.
     */
    require plugin_dir_path( __FILE__ ) . 'includes/class-funbotic.php';
    
    /**
     * Registers logic for displaying menus conditionally.
     */
    require_once dirname( __FILE__ ) . '/includes/funbotic-conditional-menus.php';
    
    /**
     * Registers shortcodes and logic to display content conditionally.
     */
    require_once dirname( __FILE__ ) . '/includes/funbotic-conditional-shortcodes.php';
    
    /**
     * Provides custom fields to be used when uploading media, focused on making a per-user gallery possible.
     */
    require_once dirname( __FILE__ ) . '/includes/funbotic-media-fields.php';
    
    /**
     * Generates shortcode for gallery populated dynamically with images tagged with the current Subscriber.
     */
    require_once dirname( __FILE__ ) . '/includes/funbotic-dynamic-user-gallery.php';
    
    /**
     * Creates relationships between user accounts to denote parent/child relationships, giving the ability for parents to monitor their children's progress.
     */
    require_once dirname( __FILE__ ) . '/includes/funbotic-parent-child-relationships.php';
    
    /**
     * Begins execution of the plugin.
     *
     * Since everything within the plugin is registered via hooks,
     * then kicking off the plugin from this point in the file does
     * not affect the page life cycle.
     *
     * @since    1.0.0
     */
    function run_funbotic() {
    
    	$plugin = new Funbotic();
    	$plugin->run();
    
    }
    
    run_funbotic();
  • Interesting. I have a custom plugin I’m creating, and am adding this code in one of the files in the /includes folder for that plugin.

    The file name is funbotic-parent-child-relationships.php. And in the funbotic.php file, I’ve made sure to include it:
    require_once dirname( __FILE__ ) . '/includes/funbotic-parent-child-relationships.php';

    Does this need to be in functions.php, or something similar? If so, why would it not function as part of the code of a plugin? (I’m still new to WordPress and web development in general, so I’m trying to learn as much as I can!)

  • Gave this a try, still no luck. The textarea remains editable, and any changes I make to it are saved when I save the user profile. (For clarification, I am currently viewing this field when editing user profiles.) I appreciate the quick response though!

  • I know this is an ancient thread, but I’m having exactly the same issues as pimschaaf, which is why I’m posting here. I’ve created a custom rule value named ‘Image’, and am trying to get it to match specifically for display/hiding purposes when editing a post with an image attachment. Absolutely nothing I’ve done so far has worked.

    
    add_filter( 'acf/location/rule_values/ef_media', 'acf_location_rule_values_ef_media' );
    add_filter( 'acf/location/rule_match/ef_media', 'acf_location_rule_match_ef_media', 10, 3 );
    
    function acf_location_rule_values_ef_media ( $choices ) {
    	$choices['image'] = 'Image';
    
    	return $choices;
    }
    
    function acf_location_rule_match_ef_media ( $match, $rule, $options ) {
    	$id = get_the_ID();
    	
    	if ( $rule['param'] = 'post_type' && $rule['value'] = 'attachment' ) {
    		if( $rule['operator'] === "==" ) {
    
    			$match = wp_attachment_is_image( $id );
    
        	} elseif ( $rule['operator'] === "!=" ) {
    
    			$match = !wp_attachment_is_image( $id );
    
    		}
    	} else {
    		
    		$match = false;
    	}
    
    	return $match;
    }
    

    Has this issue really not been resolved?

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