How to put custom admin setting field into a shortcode

Your issues aren’t shortcode-related, just some PHP syntax problems. I suggest enabling debugging so you can see PHP errors being generated. Opening <?php and closing ?> php tags are for switching between html and php output. See escaping from html in PHP documentation. A function can only return once, as it immediately ends execution and … Read more

get data with shortcode

I am not sure about your error as well, but one thing you are doing wrong. Returning data. You should be ‘collecting’ them and then returning. $data=””; foreach ( $results as $result ) { $data .= ‘ Point: ‘.$result.’ ‘; } return $data; Try this loop.

Passing values between enclosing and enclosed shortcodes

You can try this plugin: /** * Plugin Name: My Boxes Shortcode * Author: birgire * Author URI: http://wordpress.stackexchange.com/a/121423/26350 */ add_action( ‘plugins_loaded’, array( ‘My_Boxes_Shortcode’, ‘get_instance’ ) ); if( ! class_exists( ‘My_Boxes_Shortcode’ ) ) { class My_Boxes_Shortcode { static private $instance = NULL; static public function get_instance() { if ( NULL === self::$instance ) self::$instance = … Read more

call widget from within shortcode

The second parameter of this function (the_widget) is an array with some arguments that defines what are the variables of this instance of the Widget, when you are outside of a Sidebar “loop”, you have to pass those manually, instead of getting them from the database. I’ve found the GitHub Repo for this plugin, and … Read more

Problems making shortcode with custom post types and taxonomy

That is a very broken Loop. The results of a new WP_Query is not a simple array that you can foreach over. It is far more complicated than that. Try var_dump($work_galleries);. Fortunately, WP_Query provides methods to make looping easy. $work_galleries = new WP_Query($args); if ($work_galleries->have_posts()) { while ($work_galleries->have_posts()) { // this replaces foreach $work_galleries->the_post(); // … Read more

Modify a plugin function output from another plugin

I will never understand the point of these wildly complicated “helper” wrapper/plugins… but that aside… The plugin provides a lot of filters that might help you out. I think that the types_view filter might be what you want. Something like this is a plugin file or your theme functions.php might do it: add_filter(‘types_view’,’do_shortcode’); I do … Read more