How to use Wordpress shortcode inside form field value? - wordpress

I'm attempting to get a shortcode working inside a form field's value="[shortcode]".
This shortcode grabs a URL parameter and prints it. This works everywhere else on the page. It even work in double quotes outside of my form. It also works inside the form as the Submit button text. For some reason, it just won't work within the value="".
This is for an ActiveCampaign form.
Any ideas on how to resolve this? Thanks for your help in advance.

Thanks for the information about using a shortcode outside the content editor. That's useful. The standard Beaver Builder HTML module doesn't accept PHP. I found a plugin called PHP Everywhere that adds the ability to accept PHP anywhere within Wordpress. Using this, I was able to use PHP within the HTML module to use the _GET variable to grab the parameter. Cheers!

Hire one solution. Using dynamic population in Gravity Forms allows you to dynamically populate a field with a value (or values depending on the field type). This value can be passed via Query Strings, Shortcode and/or Hooks. This walk-through will give you an example of how to use each method of dynamic population to dynamically populate a field on your form! https://docs.gravityforms.com/using-dynamic-population/

Related

How to change the case of submitted value of dropdown in Formidable Wordpress Plugin?

How to change the case of dropdown values in Formidable Wordpress Plugin?
FYI - Data is populated on the website via CSV using the Import/Export option of Formidable Plugin. Data is huge (1 million), so changing the case in the data itself is not a good option.
When the form is getting submitted, the value of Code Dropdown getting saved as "Forex", but I want value will get saved as "forex". Please suggest. Thanks in advance.
Following things I have tried:
Created New Custom CSS
Added this custom CSS into Lookup Field as:
Also tried to use Customize HTML from FORM Setting as:
Here in the customize HTML code, I am unable to understand, how to tweak it, so that submitted value will be in lowercase.
For anyone still looking for an answer on how to do this, Formidable provides the ability to do this by using seperate field values for the saved data.
Directly under the Dropdown Options you need to tick the checkbox:
Use separate values
Once this is ticked you will see an additional option for each field for the submitted value. That way you can enter the lowercase value you need in the save option field.
Note you may need a Formidable base license to see this option.
More info here:
https://formidableforms.com/knowledgebase/separate-values/

Dynamically Prefill Google Forms with URL Parameters

I need to dynamically prefill a 'Google Forms' Field with a value from a GET variable in the URL.
This is the form: https://docs.google.com/forms/d/e/1FAIpQLSesGYSZgzQfqLiZIfi2JlQFQ5ttatNMZ9U8gJNA8Xa8U1X9fw/viewform
As you can see the field name is entry.253064463 then I tried with:
https://docs.google.com/forms/d/e/1FAIpQLSesGYSZgzQfqLiZIfi2JlQFQ5ttatNMZ9U8gJNA8Xa8U1X9fw/viewform&entry.253064463=myCustomValue
But not, working, the field is not dynamically prefilled.
I see no other way to get this.
Might be a bit late, but can it be that you are using the preview? I had the same issue and fixed it by using the link you get in the editor by clicking on "SEND".
It seems like parameters are not allowed in the preview.

Wordpress: get previous_post_link() based on custom field value

I have a custom post type. Pages of this custom post type are displayed via a special template. in this template i use previous_post_link() and next_post_link() to create links to previous/next posts of this custom post type.
Since I currently only want to show a few of these custom-post-type pages to my users, I created a custom field called release with a boolean true/false value to indicate if these posts should be shown.
Obviously, the previous/next_post_link() functions should also be aware of that. However, they are not currently. That means they also link to pages where the custom field released is set to false. How can I tell these functions to only use pages where a custom field (released) has a specific value (true).
Update: I know that the solution is to apply some filters to the default functions and to somehow adapt the SQL query which is used to retrieve previous/next posts. However I do not know how to put together the puzzle pieces (where/how to apply the filters and how to adapt the SQL)
This may be related to this question, however I dont really know what to do: https://wordpress.stackexchange.com/questions/8823/how-to-order-adjacent-posts-prev-next-by-custom-field-value
This seems also to be related: https://wordpress.stackexchange.com/questions/96670/custom-post-type-navigation-on-custom-field
couldn't get it to work even though I know how it SHOULD work: addFilter() for get_{$adjacent}_post_join and get_{$adjacent}_post_where with custom SQL query code..
However, this plugin did the trick for me: http://www.ambrosite.com/plugins/next-previous-post-link-plus-for-wordpress
I used the in_same_meta key.

Display all custom attributes Woocommerce

I'm working on a project where I want to display product's image and customs attributes from Woocommerce.
I already set attributes like this
I want in my php code display all the attributes (title et terms).
I already try <?php $product->list_attributes(); ?>. It works fine but data are displaying in <table>. I want to customize the display.
Thanks for your help !
Whenever I get stuck with a custom method like this in WooCommerce, I try to resort to the docs to see what is going on.
If you inspect the source for this method, you'll find that it's actually using a custom template single-product/product-attributes.php to output this table you're seeing.
In order to change the output, you have two options:
Override the template via your theme
Observe single-product/product-attributes.php and use the information there to write your own custom loop in your original template.
The second option means that you'll likely use the get_attributes() method, instead of list_attributes().

Define function name with text field

I'm only really a novice with PHP (and I know I'm sortof trying to run before I can walk), but I would like to know if it is possible to define a functions name via a textfield.
Currently, I am working with Wordpress so I can use add_option to add something to the database to store data, etc, which is handy. My idea is for a slideshow plugin which allows you to have unlimited slideshows.
It would work by typing the name into the text box then clicking the submit button to store the name. This name would then be given to a function which can be used to display that specific slideshow. Is this possible?
Sorry if this seems confusing. I know what I want to achieve, I just don't have a clue how (but I am willing to learn). Thanks.
Why do you need new functions? Sounds more like the same funxtion with different arguments, which can easily be your textfield value
1.your plugin admin page allows naming and creating slideshows, like creating a post or a gallery with a title, and adding images.
2.you place a function call in your theme where you want a slideshow to appear:
if(function_exists('display_slideshow')){display_slideshow($slideshow_name)};
3.the function display_slideshow() is included in your plugin file.
function display_slideshow($slideshow_name){
//get slideshow stuff from the database,
//using the name of the show passed as arg
//write your html and php to show the images the way you design
}

Resources