Calling a function via a shortcode in javascript

I’m afraid the code you’ve shared is rather wonky and there isn’t just one thing that is backwards. Here are the first few things that came into my mind. add_filter( ‘learn-press/after-content-item-summary/lp_lesson’, ‘psb_comment_listener_func’); When you attach a callback function to a filter with add_filter, the callback should return a value. If the callback isn’t supposed to … Read more

Is there a way to pull remotely generated XML, process it, and display it on a Managed WordPress page?

Step-by-Step Guide to Create a WordPress Plugin for Fetching and Displaying Remote XML Data 1. Create a New Plugin Directory Connect to your WordPress installation via FTP or use the file manager in your hosting control panel. Navigate to wp-content/plugins/. Create a new directory named remote-xml-fetch. 2. Create the Plugin File Inside the remote-xml-fetch directory, … Read more

Implementing onSplit/onMerge in dynamic Gutenberg Custom Blocks

Based on the use case that lead you to this, the answer is: You don’t, that’s what block styles and variations are for. Your entire block could be eliminated and replaced with this: wp.blocks.registerBlockStyle( ‘core/paragraph’, { name: ‘bc-synopsis’, label: ‘Back Cover Synopsis’, } ); .is-style-bc-synopsis { // styling etc… } Benefits: You can change your … Read more

How to submit a button automatically after every scheduled hours?

You were on the right track with the second try. Put this is functions.php, or wherever: if (!wp_next_scheduled(‘fetch_webcategories_hook’)) { wp_schedule_event( time(), ‘hourly’, ‘fetch_webcategories_hook’ ); } add_action ( ‘fetch_webcategories_hook’, ‘fetch_webcategories’ ); It’s not quite a real hourly schedule because somebody has to visit the site to trigger it, so if you have VERY low traffic it … Read more