Forum Replies Created

  • I’m late to the party, but just noticed this as well in my code.

    Has anyone reported it as a bug ? If so, what is the status ?

  • It might seem that way (to you) πŸ™‚ but it’s not…

    You need to change the post_link/post_type_link with a filter and then use a rewrite rule.

    The function on line 30 in the pastebin explains it and line 58 shows a rewrite.

    With that you should be able to adapt it to your needs.

  • @corporatic While searching for a select2 issue I’m having, I came across this topic.

    You might wanna know I have a plugin which loads countries/states/cities conditionally, plz see

  • I see a few posts, which relate to cities being loaded conditionally.

    I have written a plugin which does exactly that, specifically for cities.

  • Maybe a few years late to the party but I just discovered this plugin:

    Seems to work for me for now….

  • doesn’t that just disable the hover status ??? but afaik it leaves the ‘click’ intact… (didn’t test though)

  • I would recommend using your option @brugman.
    Correct me if I’m wrong, but I can’t see an option where the filter is not sufficient…

  • Hi @radgh your message seemed gone for me too.
    I clicked the link in the notification email shortly and it was nowhere to be found.

    I won’t be able to test your solution for at least a week due to a full (client) schedule but I’ll be sure to come back to it, if Eliot hasn’t piled on in the meanwhile πŸ™‚

  • > So, the problem is that when the field is loading after saving the post ID values do not exist on the current site.

    When ACF renders the field it does this

    That is my ‘suspicion’ indeed…

    > again, I don’t know if it will work.

    Don’t worry, you’ve given me a possible direction where to look, so I appreciate it.
    I’ll post the result when I have some time…

  • They don’t show after save. They show when I select them.

  • I think I get the gist of your ‘thinking’ but the side where you select the posts works perfectly.

    So imo I would only need to apply a filter to the right side, with a switch to blog, but couldn’t figure out which filter to use for it….

  • Thanks @sloconte. Just what I was looking for…

  • I have a way to do it, but it isn’t the most ideal one, because it’s not DRY.

    if ( 'nl' == $key ) {
        add_filter( 'acf/settings/current_language', function() {
            return 'nl';
        } );
    } elseif ( 'en' == $key ) {
        add_filter( 'acf/settings/current_language', function() {
            return 'en';
        } );
    } else {
        add_filter( 'acf/settings/current_language', function () {
            global $sitepress;
            return $sitepress->get_default_language();
        } );
  • I just remembered I fixed this issue and still had this open.

    This is my solution:

    function pg_check_values( $valid, $value, $field, $input ) {
        // bail early if value is already invalid
        if ( ! $valid ) {
            return $valid;
        if ( 1 == $value ) {
            if ( isset( $_POST[ 'acf' ][ 'field_5adf64026e9a8' ] ) && empty( $_POST[ 'acf' ][ 'field_5adf64026e9a8' ] ) ) {
                $valid = __( 'Please enter a start date', 'dpg' );
        return $valid;
    add_filter( 'acf/validate_value/name=pg_ready_to_check', 'pg_check_values', 10, 4 );
  • If someone comes across this:

    I have solved it in a completely different way.
    I just override/translate the placeholder with PHP.
    Works like a charm.

  • As you can see I have already offered help to the person who created the thread but a Vcard is NOT an ACF feature.

    And the OP already posted the format, so you’re not reading the topic.

  • @treon This is not an ACF question, so check here

  • Ok.. gotcha… will shoot him an email…

  • This is my function now.

    function pg_check_html_tags_text( $value, $post_id, $field ) {
        if ( $value != strip_tags( $value ) ) {
            $allowed_tags = array();
            $value        = wp_kses( $value, $allowed_tags );
        return $value;
    add_filter( 'acf/update_value/type=text', 'pg_check_html_tags_text', 10, 3 );

    Could it be ‘fixed’ by adding $value = html_entity_decode( $value ); before if ( $value != strip_tags( $value ) ) { ?

  • Fair enough…

  • Damn, was hoping you had a way… Disabling text inputs is no prob but this color thing…

    Adding a class hidden (which is display: none) doesn’t seem to work either (for me).

  • @soullighter Did you find a solution to this by any chance ?

  • I can’t tell what’s wrong just from this little piece of code…

    It also depends what you wanna do… Just look at the code and dissect it to fit your needs.

  • See page 3

  • LOL @ smitxv : did you actually bother to read the topic ? There are 2 custom solutions in this topic and 1 native…

Viewing 25 posts - 1 through 25 (of 289 total)

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.