How to get option values without requiring wp-load?

You could use Hooks , If you wish to print some styles in head just try add_action(‘wp_head’, ‘test_123’); function test_123(){ $options = get_option(‘option’); //Output it however you want 🙂 ob_start(); ?> <style type=”text/css” id=”someStyleInHead”> body.home{ font-size: <?php echo $options[‘fs_h’]; ?>; } </style> <?php $code = ob_get_clean(); echo $code; } I hope it help 🙂

how to retrieve post_id under woocommerce_add_to_cart_validation hook?

woocommerce_add_to_cart_validation passes the product id as the second argument to the callback function, so you can access it like this: function custom_fields_validation( $passed_validation, $product_id ) { if( isRecurring( $product_id ) ) { if ( empty( $_POST[‘inputday’]) ){ wc_add_notice( __( ‘Please select field 1;’, ‘woocommerce’ ), ‘error’ ); return false; } if ( empty( $_POST[‘inputtime’] )){ … Read more

How to load css file after a certain css file

You have three options to enqueue a CSS after one another. You can either: Increase the priority of the hook You can set the hook’s priority as follows: add_action(‘wp_enqueue_scripts’, ‘some_function’, 999); function some_function() { wp_register_style(‘bmg- … -public’, plugins_url(‘…’, __FILE__),array(‘plsh-style’)); wp_enqueue_style(‘bmg- … -public’); } This comes in handy when you are using a plugin to enqueue … Read more