Customise standard lists within my shortcode

IMO you need to create individual shortcodes for UL, OL and LI to make it sample. Shortcode for UL. function shortcode_ul( $atts , $content = null ) { return ‘<ul>’ . do_shortcode( $content ) .'</ul>’; } add_shortcode( ‘ul’, ‘shortcode_ul’ ); Shortcode for LI function shortcode_li( $atts , $content = null ) { return ‘<li>’ . … Read more

How to process a single attribute in a SQL request twice times?

WordPress 4.8.2 specifically restricts the convenient usage of numbered placeholders like %1$s, %1$d, %1%f in WPDB::prepare. (core.trac.wordpress.org/ticket/41925). To avoid usage of numbered placeholders, SQL query has to be rearranged to just use only one %s. SELECT DISTINCT t.`Date`, y.* FROM `table` t LEFT JOIN `table` y ON (t.`Date` = y.`Date`) WHERE t.`country` = %s ORDER … Read more

Secretly passing post ID/title etc into a shortcode form automatically to link submission to post

If you put a unique placeholder value there, you can do a find/replace via the_content filter, which runs after the shortcode is rendered, but before the content is output in the template. For example, this will replace any occurrence of replacethisthing with the post ID: function wpd_replace_something_in_the_content( $content ){ return str_replace( “replacethisthing”, get_the_ID(), $content ); … Read more