Change default settings used by gallery shortcode

The shortcode_atts_{$shortcode} filter allows default parameters to be modified for shortcodes. To modify the shortcode, we’ll use the shortcode_atts_gallery filter. Here is an example that changes the defaults for the columns and link parameters in the shortcode. Note that if the user specifies values for these parameters, those values will be used; we’re just changing … Read more

Finding where a shortcode comes from

Just use the Windows search bar in wp-content directory and search for companyName_apply_form. You should find the file where the shortcode is created. To add a shortcode in WordPress you normally use this syntax: ‘add_shortcode(“shortcode_name”, “function_name”)’

Export User Info to CSV from Front End

Nevermind, I figured out a way to make it work. I just removed the need for a url altogether. Here’s what I did in case anybody else wants to know. I changed the link to an form input button: <form method=”post”> <input type=”submit” name=”bc_export” class=”btn btn-export” value=”Export Store List for ‘.$atts[‘value’].'” /> </form> And changed … Read more

Creating a table from shortcode avoiding wpautop for each row

The extra space comes from wpautop(), which inserts <br /> on every line break. You have to strip these out before calling do_shortcode(). Additionally, use add_filter( ‘the_content’, ‘shortcode_unautop’ );. From my experience, you need both. Probably a bug. See my shortcode plugin for an example. It has shortcodes for tables too. Aside: Shortcodes should never … Read more

Cannot strip JW Player shortcode?

JW Player Plugin for WordPress does not register its shortcode like all other shortcodes, so strip_shortcodes() will not know about it and not strip it. In the code there is a note that this is because it uses argument names with a . in it, and WordPress does not support this. There are probably multiple … Read more

Shortcode content does not show in feed discription/excerpt

Ok I had to write my own custom excerpt like such: function custom_excerpt($text=””) { $raw_excerpt = $text; if ( ” == $text ) { $text = get_the_content(”); // $text = strip_shortcodes( $text ); $text = do_shortcode( $text ); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘]]>’, ‘]]>’, $text); $excerpt_length = apply_filters(‘excerpt_length’, 200); $excerpt_more = apply_filters(‘excerpt_more’, ‘ … Read more

Possible to create placeholder images in WordPress editor that are clickable (should bring up uploader)?

such an answer would likely become unworkable/unusable after a WordPress update, as TinyMCE get updated and APIs change – by @TomJNowell While I agree with Tom, there still an be a general answer that explains the general concept and the parts that aren’t moving. The PHP plugin to set the default content First there has … Read more

Get multiple shortcode attribute values

Don’t try to shove everything into a single attribute, or a single shortcode even. The string parsing you have to do will get more and more complicated. Try this: function myshortcode_cb( $atts ) { $atts = shortcode_atts( array( ‘cat’ => ”, ‘title’ => ” ), $atts ); // var_dump($atts); // debug return “{$atts[‘cat’]} :: {$atts[‘title’]}”; … Read more

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