remove Woocommerce “add to cart” to be “Download” button [closed]
remove Woocommerce “add to cart” to be “Download” button [closed]
remove Woocommerce “add to cart” to be “Download” button [closed]
You’re calling $this->update_product(); too early, I guess just after you’ve constructed the object? It is then calling wp_update_post before everything else has finished loading, in this case the $wp_rewrite global which isn’t available until the setup_theme event. You should probably call update_product() from the init hook instead: add_action( ‘init’, [ $this, ‘update_product’ ] );
Setup WPGraphQL Offset Pagination and run: query tags { tags { nodes { posts(where: {categoryId: 7}) { pageInfo { offsetPagination { total } } } } } }
WP Scripts provides no such feature for automating this, and if it did automate this it could cause problems. The version in block.json is not the version of your plugin, it’s the version of the block, and doesn’t have to match. Most people are unaware a version parameter even exists. Likewise if you update your … Read more
Use the parameters of the shortcode with lowercase: [recurring_event short=”Wed” full=”wednesday”] Try to follow the next code: // NAV: Custom Code function wpcoder_recurring_event_att( $atts ){ $date=””; $default = array( ‘short’ => ‘Sun’, ‘full’ => ‘sunday’ ); $eventday = shortcode_atts($default, $atts); date_default_timezone_set(‘US/Eastern’); if(date(‘D’) == $eventday[“short”]) { echo date(‘F d, Y’); } else { // Create a … Read more
The default supported recurrences are ‘hourly’, ‘twicedaily’, ‘daily’, and ‘weekly’. From the WordPress definition https://developer.wordpress.org/reference/functions/wp_get_schedules/ If you’re using wp_schedule_event(time(), ‘every_minute’, ‘recurring_event’);, you may need to change the recurrence parameter to one of the correct options mentioned above. Refer to the documentation for guidance. To check and trigger your Cron function, you can use a plugin … Read more
You are going to want to edit this line: add_action( ‘plugins_loaded’, create_function( ”, ‘global $BBCode; $BBCode = new BBCode();’ ) ); You will want to make yourself an actual function. Probably something like this: function my_hacked_function(){ global $BBCode; $BBCode = new BBCode(); } add_action( ‘plugins_loaded’, ‘my_hacked_function’); I’ve not tested this. However, this is the general … Read more
Enabling PHP logging and reading logs showed the problem, thanks to Tom. // Enable WP_DEBUG mode define( ‘WP_DEBUG’, true ); // Enable Debug logging to the /wp-content/debug.log file define( ‘WP_DEBUG_LOG’, true ); // Disable display of errors and warnings define( ‘WP_DEBUG_DISPLAY’, true ); [16-Jan-2024 09:34:09 UTC] PHP Notice: PHP’s XML extension is not available. Please … Read more
There are 2 problems here Problem 1: Scope The missing piece of the puzzle is scope. Scope isn’t a WordPress thing, it’s a fundamental programming feature, to use a global variable in a scope you have to declare to PHP that it’s a global variable. If you use it somewhere else without declaring that it’s … Read more
You could consider using is_tax: Determines whether the query is for an existing custom taxonomy archive page. You can pass in the taxonomy slug to test if the current taxonomy archive page is for your taxonomy: if ( is_tax( ‘my_taxonomy’ ) ) {