Modify function Shortcode_atts

You are misusing shortcode_atts(). You need to pass the shortcode an array of defaults in the first argument, which you have done. Then you need to pass the user supplied arguments in the second argument, which you haven’t done. Your shortcode callback uses $params yet for some reason you are passing $atts, which is not … Read more

Override default password nag in WordPress

The function is hooked to an action, so you should be able to remove it. remove_action(‘admin_notices’,’default_password_nag’); You can then add back a function of your own choosing. Rename your function to something that won’t conflict with the Core function name and… add_action(‘admin_notices’,’my_password_nag’); You will need to create a plugin or mu-plugin to do it, but … Read more

A blank page is shown after I add a Function

Have you tried this: <?php add_action( ‘template_redirect’, ‘wp138320_template_redirect’ ); function wp138320_template_redirect() { if ( ! current_user_can( ‘manage_options’ ) ) { include( get_template_directory() . ‘/holding.php’ ); exit; } } ?> I’m currently working on a site that has issues with hooking into actions/filters like that too, changing it to something like the code above did the … Read more

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