multiple record insert creating many duplicate records

For running in WP cron, you’ll define your function, and then hook the function to the cron’s name. Example: function cron_function() { … } add_action( ‘cron_hook’, ‘cron_function’ ); if ( ! wp_next_scheduled( ‘cron_hook’ ) ) { wp_schedule_event( time(), ‘one_minute’, ‘cron_hook’ ); } See WordPress developer resource for more info: https://developer.wordpress.org/plugins/cron/scheduling-wp-cron-events/

A multi-section WordPress store [closed]

It’s possible to build a multi-section online store using WordPress and WooCommerce but it does come with its complexities. Having the three sections integrated within the same site can be advantageous in terms of shared traffic, cross-selling opportunities, and providing a diverse product/service mix to your visitors. However, this setup will be more complex and … Read more

Accessing Correct Database to Create REST API Endpoint

You can access another database using the wpdb class and its associated methods. You will need to instantiate a new connection to the other database using the appropriate credentials. Here is the basic code to set up the new connection and query the database: $mydb = new wpdb(‘username’,’password’,’database’,’localhost’); $rows = $mydb->get_results(“<your SQL query here>”); Replace … Read more

WordPress custom block: Link saved in database not retrieved when editing post

Your selectors are wrong. { attributes: { link1: { type: ‘string’, source: ‘attribute’, attribute: ‘href’, selector: ‘.btn-afil-text-card a:first-child’ }, link2: { type: ‘string’, source: ‘attribute’, attribute: ‘href’, selector: ‘.btn-afil-text-card a:last-child’ } }, } Both of your a elements are the first (and last) children of their parents, which means that your attributes are each getting … Read more