Passing an array from shortcode-function to filter-function

Okay, it turns out that I was missing a tiny little number in the add_filter command. The line: add_filter( ‘the_content’, array( &$this, ‘after_content’ )); should be: add_filter( ‘the_content’, array( &$this, ‘after_content’ ), 12); And now all works. The array is accessible inside the filter-function. This number is a priority variable: https://developer.wordpress.org/reference/functions/add_filter/, but if anyone will … Read more

In woocommerce cart item we can add custom text but how can i add custom link? [closed]

You can use below code for your requirement. it will add website/file url to cart page, checkout page and order summary in back-end. You need to create one custom field for website/file url in product page. https://prnt.sc/pa7fyg that url/link will be display at: in product detail page above add to cart button. https://prnt.sc/pa7h9s Cart page … Read more

Remove unwanted elements for a wp_nav_menu

I got it to work by reconfiguring the walker class custom_menu extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( “\t”, $depth ) : ”; $class_names = $value=””; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( … Read more