echo $plugin_folder= plugins_url(); To get any specific file inside plugin directory use : Here getting path of file ‘widget_newslider11123.html’ insde plugin “books” echo plug...Read More
Current plugin folder path : plugin_dir_path( __FILE__ ) To include a file in this path: include(plugin_dir_path( __FILE__ ).”widgetfile.html”);...Read More
add_action(‘admin_menu’, ‘avg_rate_add_page’); function avg_rate_add_page(){ // Add main menu add_menu_page(‘Bonuspoints’, ‘Bonus point’, ‘adminis...Read More
Inside a function or any where add below code : add_option(‘new_field_name’,’value’); eg: add_option(‘bonus_points_for_price’,’1′); Getting value from t...Read More
After creating plugin and writing required hooks, we can create tables. We can call these function inside acivation hook. So once we activate the plugin, table creations will be done. /* Plugin Databa...Read More
Using register_uninstall_hook we can register the uninstall hook. /* Plugin Uninstall Hook Here */ register_uninstall_hook(__FILE__, ‘avg_point_uninstall’); function avg_point_uninstall(){...Read More
Using register_activation_hook we can register the activaton hook. /* Plugin Activation Hook Here */ function avg_point_activation(){ global $wpdb; } register_activation_hook(__FILE__, ‘avg_poin...Read More
“woocommerce_order_status_” used to define a callback for any order status changed. It works once we changed the order status So here we need to specify the action. Usually used once we declare a ...Read More
“woocommerce_order_action_” used to define a callback for any order action occurred. It works once we changed the order action So here we need to specify the action. Usually used once we declare a...Read More