How to display data from custom fields in my custom shortcode?

You simply need to query your custom fields and return them with your shortcode: // EXAMPLE USAGE: // [loop the_query=”showposts=100&post_type=page&post_parent=453″] function custom_query_shortcode($atts) { // Defaults extract(shortcode_atts(array( “the_query” => ” ), $atts)); // de-funkify query $the_query = preg_replace(‘~&#x0*([0-9a-f]+);~ei’, ‘chr(hexdec(“\\1″))’, $the_query); $the_query = preg_replace(‘~&#0*([0-9]+);~e’, ‘chr(\\1)’, $the_query); // query is made query_posts($the_query); // Reset and setup variables $output=””; … Read more

Gravity Forms After Submission – GFFormsModel::update_lead_field_value?

Going to close this and answer myself. Apparently, there is something wrong with the way that GFFormsModel::update_lead_field_value truncates fields. I was unable to get this to work. Instead – I opted to use a direct WP insert (with if elseif etc…) – like so : $csql = $wpdb->insert(“wp_rg_lead_detail”, array(“id” => NULL,”lead_id” => $lead,”form_id” => $form,”field_number” … Read more

Combining wp_current_user() and a variable

What you have is mostly just PHP errors. First, dashes are not valid characters in variable names, so are going to have trouble with this– badge-id-$badge_ID— no matter what. You should be using underscores instead. Second, you need to construct the entire object variable string beforehand, rather than try to construct it as you are … Read more

Trying to the deduce shortcode from a function

I wonder if this would work: [tabs tab1=”Tab 1″ tab2=”Tab 2″ tab3=”Tab 3″] [tab id=”1″]Content for tab one goes here.[/tab] [tab id=”2″]]Content for tab two goes here.[/tab] [tab id=”3″]]Content for tab three goes here.[/tab] [/tabs] You should also check if the shortcode definitions exists: add_shortcode( ‘tabs’, ‘some_function_for_tabs’ ); add_shortcode( ‘tab’, ‘some_function_for_tab’ );

Function to return custom post type titles from blog id 1

It’s returning just 1 post title because everytime it reads a post it replaces the content of the var $titles with the title of the current post. Try this, it will return an array with the post titles. function getctas() { $titles_array = array(); switch_to_blog(1); $args = array( ‘post_type’ => ‘location_icons’ ); $ctas = new … Read more