this is my model file i am facing error that is: Answer Your class definition is not correct. your not defining the scope of the functions, and you need to refer back to the class in the add action
Tag: wordpress-plugin-creation
Converting Javascript data to PHP using ajax in wordpress plugin development
I’m building my first wordpress plugin and I’m having trouble converting a Javascript array of objects into PHP so I can use the data to create individual tables in the wp-admin user area. Before i actually include the object, i thought i’d try with just a single variable. Firstly, i included the wp-admin/admin-ajax.php url in wp_localize_script to use in my
Custom shipping rates programmatically in Woocommerce
I Want to calculate custom shipping rates based on cart amount for woocommerce, My requirement as follows, Cart amount 0-10 => £4.99 (shipping_rate_id = flat_rate:12), 10-20 => £3.99 (…
Loading Templates from a plugin in WordPress
I’m trying to make my first plugin and I got stuck. Here is the idea. When my plugin is activated it will create one post type and two taxonomies for that post type (in my case the post type name is ‘Ads’). Also, I created two template pages, one to display the listing of all ads post type articles and
Woocommerce Product Category taxonomy in Admin Pages
I’m writing a plugin for WordPress using WooCommerce. I need to get the list of WooCommerce Product Categories (taxonomy ‘product_cat’) in the admin page of the plugin (note the emphasis on “…
WordPress plugin approval standards: ## Calling file locations poorly
I’ve submitted a widget to Wordpress.org and received this guidance: The way your plugin is referencing other files is not going to work with all setups of WordPress. When you hardcode in paths like wp-content or your plugin folder name, or assume that everyone has WordPress in the root of their domain, you cause anyone using ‘Giving WordPress it’s own
How do I add page to wordpress website and giving it a specific short code via custom plugin
I have made an action that allows a page to be made if the switch in the setting is checked. After it is confirmed it’s checked it does create the page, but without the template added. How do I get my template to work? This is what my template page looks like in the plugin. Answer In my case, I