PHP Widget and do_shortcode

The problem was the double quotes which are needed in normal shortcode usage in posts and pages for some reason when using do_shortcode the double quotes in the attributes where breaking the function. Working code below <div> <?php $lat = get_field(‘woo_maps_lat’); $long = get_field(‘woo_maps_long’); echo do_shortcode(‘[forecast location=’ . $lat .’,’.$long. ‘]’); ?> </div>

Form submit from modal window to parent window

Use the parent method to pass data back to your meta field. Create a JS function to handle the passing of data from Thickbox to the meta field: function foo_interstitial(data){ $(‘.form-field-selector’).val(data); } Add a submit handler to your thickbox instance that passes to the parent.foo_interstitial() function. $(‘.thickbox-submit-selector’).submit(function(){ var _value_to_pass = $(‘.field-to-pass-selector’).val(); parent.foo_interstitial(_value_to_pass); });

Parse Shortcodes in Theme’s Custom Field?

You can use the do_shortcode() function. do_shortcode(‘[your-shortcode option1=foo option2=bar]’); Or in your case: $price = get_post_meta($post->ID, ‘_price’, true); #Dynamically generate the plugin shortcode $new_price = do_shortcode(“[plugin-shortcode price=$price]”); Hope this helps you out!

add php shortcode in return function

Do not call do_shortcode(). Use the associated handler instead. And if you want to call the shortcode without parameters you have to make the parameters optional in the handler’s declaration: function custom_slidessc($atts = array(), $content = null) So what you need is: return ‘<img>’ . custom_slidessc();

WordPress do_shortcode first iteration

Figured out both issues. You can keep a count and find out when you are on the first iteration in the same go. static $count; if(!$count) { $count = 1; $state=” active”; } else { $count++; $state=””; } From the PHP Manual. “A static variable exists only in a local function scope, but it does … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)