Forum Replies Created

Viewing 15 replies - 286 through 300 (of 564 total)
  • Thread Starter John Huebner

    (@hube2)

    Well, I figured it out, and it’s not an issue with this plugin.

    Just in case someone else runs into a similar problem I will explain what the problem was.

    On all of our WP sites we have a plugin that inserts a script near the top of the <head> of the page before the og meta tags. It was the existence of this script tag that caused the issue. Setting the priority on this script loading so that it loads below the og tags corrected the issue with FB.

    While this fixed the issue I’m still confused about why the issue existed in the first place. 1) There was no issue without SSL, everything worked fine. 2) Only FB seems to have this issue, all other sites were reading the og tags.

    Thread Starter John Huebner

    (@hube2)

    NM, was not a problem with this plugin, twas something else

    Thread Starter John Huebner

    (@hube2)

    Actually, I don’t no what the exact problem is. I do know that we have recently been switching sites from http to https and for almost every site we’ve done this for, once completed, Facebook, and only Facebook can will no longer show the og image. Every other social site or site that reads this tag works fine. We’ve been looking into this for a week and I came across that post on stack.

    I’m not sure what I can provide you that will help.

    We have a site, it is not SSL. This site already has content shared on Facebook. We switch the site to SSL and Facebook can no longer show the og image. In addition to this, any new posts that are shared suffer from the same issue. Some of the sites we’ve converted have been on SSL for over a month now.

    Plugin Author John Huebner

    (@hube2)

    No, it isn’t. This plugin is limited in what it can accomplish.

    I have to agree with you @amityweb. I will not use a plugin that requires anonymous rest api access for any reason. Just another reason to find another solution as far as I’m concerned.

    Plugin Author John Huebner

    (@hube2)

    In it’s simplest form.

    You create a filter function that will return your select values. You name both the function and the hook used to call that function.

    Let’s say that you want to use the function named ‘my_function_name’

    
    function my_function_name($choices, $args=array()) {
      // generate choices
      return $choices.
    }
    

    A note about why I chose 'label' => value' pairs instead of 'value' => 'label'. There are times when you want to have multiple labels that have the same value. This cannot be done if the value is the array index (key) since only one index of a value can exist in an array. So if we did this

    
    $choices = array(
      '1' => 'First Label for Value 1',
      '1' => 'Second Label for Value 1'
    );
    

    Then there would be only one choice with the value of 1, the second one, since the first index of ‘1’ is overwritten by the second index of ‘1’. However this works perfectly

    
    $choices = array(
      'First Label for Value 1' => '1',
      'Second Label for Value 1' => '1'
    );
    

    Now let’s move on to the hook. You name the hook that calls your function. I realize that this may be a complex notion for those that are only used to adding functions to hooks that exist in WP and are added by plugin devs so that you can create filters and actions for the hooks. Why did I do this. Let’s say that you have 10 different select fields. If I chose the hook name, instead of providing a field where you just enter a custom hook I would instead need to sent your filter function the name of the field and then you’d need to make decisions based on the field name on what you wanted to do. From my point of view this is easier, the hook is called, one function is run and I do not need to do any complex if/elseif/elseif in my function based on the field name. I know I can just generate the values. This reduces the overall code that needs to be written and the complexity of that code.

    So let’s say that you want to use a the hook ‘my-hook-name’, you need at call the WP add_filter() function the same as any other filter, but using your custom hook name.

    
    add_filter('my-hook-name', 'my_function_name', 10, 2);
    

    Now you add the select field you your form and you supply the value of “my-hook-name” when creating the field.

    The rest is optional. Let’s say that you want to provide some other value to your filter function that will be used in making decisions about the choices to be returned. You can do this by adding them to the hook name that you add. For example, let’s say that for a particular field what I want is to get all of the post names in a specific category and that category has an term_id of 205. Then in the value of the field I would enter my-hook-name term_id=205.

    This additional value would be passed in the second argument of my function, see the function I posted above

    
    function my_function_name($choices, $args=array()) {
    

    In this particular case $args would be passed and look like this

    
    $args = array(
      'term_id' => '205'
    );
    

    You can pass as many arguments to your filter as you need to pass and each will become an name => value pair in $args.

    I can’t say if any of this has helped.

    Thread Starter John Huebner

    (@hube2)

    NM, figured it out.

    Look at the code and find the div for the box

    
    add_action('admin_menu', 'remove_boxes', 20);
    function remove_boxes() {
      remove_meta_boxes('meta-box-div-id', 'post-type-or-other-page-identifier', 'side');
    }
    
    Thread Starter John Huebner

    (@hube2)

    yeh, it’s pretty odd and only happens if for some reason that one script does not load. Although now that I know what it is I will know when it happens so I don’t go changing the settings for the wrong post type or taxonomy… again 🙂

    I have created a solution. It’s actually more of a hack than a real solution at this point.

    It will not submit or work with some field types, for example it will not upload files and there are likely some other more complex fields that it can’t handle.

    You’ll need to test it with your specific forms to see if there are any issues. I will not be able to fix most problems when it comes to fields that do not work, but if anyone runs into any specific situations where it does not work I would appreciate it if you open a ticket over on github to let people know what problems they might have.

    You can find it here https://github.com/Hube2/wpforms-ajax-submit

    • This reply was modified 8 years, 10 months ago by John Huebner.

    Is there any news on this? Using OptinMonster as given on the site is not an exceptable solution for my current project and I must have this functionality. I don’t care if I need to build it myself, but without it I’m going to have to use another form plugin, which is sad since I have everything for life version. This is a serious flaw in an otherwise perfect form plugin.

    Plugin Author John Huebner

    (@hube2)

    I just did a quick test of the latest version and I cannot reproduce the problem you reported.

    Can you provide an export of the repeater field where this is happening?

    Can you open an issue on GitHub https://github.com/Hube2/acf-user-role-field-setting/issues, and upload the exported field group there so I can do some more testing?

    Plugin Author John Huebner

    (@hube2)

    This is not possible using this plugin.

    Can anyone following this thread confirm that version 4.9 works with anonymous rest api access disabled?

    Edit: Never mind my question, I was logged into the site I was testing.

    • This reply was modified 8 years, 11 months ago by John Huebner.
    Plugin Author John Huebner

    (@hube2)

    Thanks for the bug report. I just pushed a nee version that should fix this issue. Please let me know if you have any more problems.

    Plugin Author John Huebner

    (@hube2)

    I would probably use the acf/prepare_field function to convert the field you don’t want users to edit into a message field. I would think about adding something like that to this plugin, but it would only be useful for basic fields, and ever then, converting many of the fields values to messages would not be a straight forward thing. I’d end up with more code to do the conversions than is currently in the entire plugin.

Viewing 15 replies - 286 through 300 (of 564 total)