Detect the activated theme from plugin code
You can use wp_get_theme to get current theme object. $current_theme = wp_get_theme(); And it will return WP_Theme object.
You can use wp_get_theme to get current theme object. $current_theme = wp_get_theme(); And it will return WP_Theme object.
This is… nothing that can be answered in a few sentences. I will try to help. 1.: Make yourself comfortable with the way blocks are built, especially using node and webpack. I found a pretty good tutorial here: https://css-tricks.com/learning-gutenberg-1-series-intro/ 2.: Write down what kind of additional controls outside of the Embed URL you want to … Read more
If you want to make sure the data bypasses any front-end caching, you should use AJAX to request the data and print it on the page. What I’d suggest is keeping your shortcode, but using AJAX to update it but creating a REST API endpoint. To do this you would abstract away the API request … Read more
try this below code in your function.php file or in your plugin add_action(“init”, function () { // removing the woocommerce hook foreach( WC()->cart->get_cart() as $cart_item ){ $product_id = $cart_item[‘product_id’]; if($product_id!=’19’) { remove_action(‘woocommerce_checkout_process’, ‘my_custom_checkout_field_process’); } } });
Options store values, and the plugin you’re trying to adjust has committed the cardinal sin of storing PHP serialised data in the database, complete with all the security and maintenance problems that come with it. You won’t find any WordPress APIs that let you update or add to that serialised value, but you can deserialise … Read more
I have revisited your code as there was some mistakes (everything is commented in the code). Also: You can use current_user_can() to check a user role for the current user. You can use has_term() conditional function to check for post terms of any taxonomy. The following code will hide products that belongs to a specific … Read more
Actually, your code is working, as long as $val == ‘on’. Did you try debugging by doing echo $val ? If it’s still not working, try hard refreshing (Ctrl + F5) your webpage, checkboxes tend to keep their state on normal refresh (F5). Also, please put your code directly on this forum, so the code … Read more
You must specify in the roots sage theme composer.json the runtime where autoload can find the classes. “autoload”: { “psr-4”: { “App\\”: “app/”, “App\\Blocks\\”: “app/Blocks/”, “Itineris\\AcfGutenblocks\\”: “../../plugins/acf-gutenblocks/src/”, } } Don’t forget to run composer dump-autoload
Explanation: The issue you are likely facing is that you are trying to add your ajax actions from within the widget itself that may be instantiated on the elementor/widgets/widgets_registered hook. If so, this is hook elementor/widgets/widgets_registered is too late and do_action( “wp_ajax_{$action}” ) and do_action( “wp_ajax_nopriv_{$action}” ) have already fired. Working example: NOTE: very rough … Read more
It’s not possible with just WordPress to schedule code to run in the background at a specific time. WordPress, like most (if not all) PHP web applications, only actually runs in response to a URL being accessed, and a request being made to the server. For a scheduled event to run at a certain time, … Read more