Display file contents within Plugin
Display file contents within Plugin
Display file contents within Plugin
Thanks to @fuxia, adding data to allowed protocols fixes the problem and I can happily use return. add_filter( ‘kses_allowed_protocols’, function ( $protocols ) { $protocols[] = ‘data’; return $protocols; });
You can try this: function woo_prod_categories() { if ( is_product() ) { global $post; $product_cats = get_the_terms( $post->ID, ‘product_cat’ ); if ( ! empty( $product_cats ) && ! is_wp_error( $product_cats ) ) { $cat_links = array(); foreach ( $product_cats as $product_cat ) { $cat_links[] = ‘<a href=”‘ . get_term_link( $product_cat->term_id, ‘product_cat’ ) . ‘”>’ . … Read more
It looks like this code is expecting slugs, which in the shortcode would look like this: [portfolio columns=”3″ title=”My Title” portfolio=”cat20,cat22,cat35″] (or whatever the actual category slugs are) instead of ids. If slugs in the shortcode are ok, it looks like this might work as written. If you wanted IDs, you’d need to add ‘ids’=> … Read more
Exclude needs to be in the $cat_args, and in the shortcode_atts. Like this: extract( shortcode_atts( array( ‘exclude’ => ”, ‘categoriespostcount’ => ‘on’, ‘categorieshierarchy’ => ‘on’, ), $atts ) ); $cat_args = array( ‘exclude’ => $exclude, ‘taxonomy’ => ‘theme_portfolio_categories’, ‘show_count’ => $c, ‘hierarchical’ => $h, ‘echo’ => 0 );
You can combine these two shortcodes into one by using a custom shortcode that includes both of them: function custom_shortcode() { $output=””; // Get the wpcode shortcode output $wpcode_output = do_shortcode(‘[wpcode id=”2658″]’); // Get the wpdiscuz_comments shortcode output $wpdiscuz_output = do_shortcode(‘[wpdiscuz_comments]’); // Combine the two outputs into a single output $output .= $wpcode_output . $wpdiscuz_output; … Read more
How to prevent WP query searching in executed shortcodes
Using the_field(); will just return the content of that field (guessing it’s just text field?). <?php if (is_user_logged_in()) { $userid = get_current_user_id(); get_userdata($userid); $shortcode = get_field(‘view_files_shortcode’, ‘user_’ . $userid); } ?> <?php echo do_shortcode($shortcode); ?>
Shortcode Displays 2 times
Working with Shortcode, AJAX, Elementor