When echoing my own shortcode, it keeps adding a 1 at the end of my blogpost

This is your problem: public function listLayout() { return require( $this->plugin_path . “/admin/itemList.php” ); } Shortcodes need to return their output as a string, but this does not. The shortcode is outputting directly, rather than being output at the correct time by WordPress. This would become very apparent if nested shortcodes were used as the … Read more

Additional classes `undefined` after saving post in Gutenberg

After about an hour of trial and error, I found that the outmost <Fragment> was the culprit. But I still can’t figure out why! Replacing it with <div> fixed it. So the code looks like this now: edit: (props) => { const {attributes, setAttributes} = props; const headingBgOverlay = Util.getBgOverlay(attributes, ‘heading’); const bodyBgOverlay = Util.getBgOverlay(attributes, … Read more

Using WordPress PHP code, how to bulk delete only 100 subscribers at a time from thousands of users?

Here you will find all parameters supported by get_users(). $blogusers = get_users( [ ‘role’ => ‘subscriber’, // limit the number of rows returned ‘number’ => 100, ] ); foreach ( $blogusers as $user ) { wp_delete_user( $user->ID ); } Or return only ID: // $blogusers is array of IDs $blogusers = get_users( [ ‘role’ => … Read more

Using a custom shortcode from within the template of a shortcode plugin

If I understand it correctly, inside the shortcode template, you could do something like this: echo do_shortcode( ‘[ta-intentclicks-link url=”‘ . esc_url( $list_item[‘link’] ) . ‘”]Visit website[/ta-intentclicks-link]’ ); But then, instead of having to use do_shortcode(), you could actually simply call the shortcode callback from the (shortcode) template ( which then eliminates the need to find … Read more