Articles of plugins

Adding Button to Shop Page in WooCommerce

Client has had me making tweaks to WooCommerce, most solutions through CSS. This one, despite being simple, has had me stumped. For each result that is returned on shop page client wants me to add a button next to “Add to Cart” that links to the product page (instead of just having clicking on the […]

Advanced Custom Fields

I am using the Advanced custom fields plugin to add a upload image option to a page, but I am wondering if there is a way so that, when I output it to a theme with <img src=”<?php the_field(‘add_image’); ?>”/> it is not full size, it is cropped or set to one of the wordpress […]

Enqueue WordPress plugin scripts below all other JS

I am developing a simple WordPress app but I am having an issue as all of the plugin scripts are rendered before those which are enqueued in my functions.php. Here is a sample section of the functions.php: function my_scripts() { wp_register_script(‘app-js’, get_template_directory_uri() . ‘/javascripts/app.js’, array(‘jquery’), null, true ); wp_enqueue_script(‘app-js’); } add_action( ‘wp_enqueue_scripts’, ‘my_scripts’); The important […]

get_option compatible with wordpress network (multisite)?

I have this function in a plugin that works on wp install but it doesnt work on wordpress MU. if( !get_option( $option-name ) ) { // something } else { // something else } How can I make the get_option compatible with Multisite install. // I am using redux framework, I created an option and […]

How to get list of Scripts in Order of Dependencies

I was writing plugin for combining JS and CSS as three plugins I tried has not worked for me. Dependency problem is where I stopped. It look tough. Then I thought WordPress can itself help. How to get list of files in order of dependencies? Is there any WP method for this? Can I use […]

How to add meta box to plugin admin page?

There is the codes. add_action(‘admin_menu’, ‘test’); function test(){ add_menu_page( ‘Test plugin’, ‘Test plugin’, ‘manage_options’, ‘test_plugin_options’, ‘test_plugin_admin_options’ ); } And there is the add_meta_box code: function inf_custome_box() { add_meta_box( ‘inf_meta’, __( ‘Meta Box Title’, ‘test’ ), ‘custome_box_callback’, ‘test_plugin_options’ ); } add_action( ‘add_meta_boxes’, ‘inf_custome_box’ ); function custome_box_callback() { echo ‘This is a meta box’; } But it’s […]

How to integrate plugin in WordPress theme

I have read that there are two ways for integrating a plugin on a WordPress theme. I think the first method is the best; but I do not know exactly how to do it… After copying the plugin to the plugin directory of WordPress… How do I enable it? Do you know another way to […]

How to get subscription key or id using Woocommerce Subscriptions

I need to get the subscription key of a particular subscription to pass into a custom function. I have referenced the documentation where it shows how to get the key, but I have failed to integrate this into my code. So what my code does is, when a renewal is triggered, I hook into processed_subscription_payment […]

Can a plugin still effect a site even after deletion?

I haven’t been able to find an answer on whether or not this can happen. If there is a poorly built plugin that hasn’t been updated in two years, and I make the poor decision to install it anyway – is it possible that even after complete deletion in the FTP this plugin could still […]

Why is my ajax call refreshing the page?

I’m attempting to upload an audio file via AJAX form. Here is my HTML in the profile-edit template. <form method=”post” id=”my_upload_form” action=”” enctype=”multipart/form-data”> <input type=”file” name=”file” id=”my_file_input” accept=”audio/*”> <input type=”submit” class=”btn-submit btn-sumary” value=”upload audio file” name=”submit” id=”my_audio_submit”> <div id=”my_error_report”></div> </form> Here is my jQuery: $(‘#my_upload_form’).submit(function () { var css = ‘font:Helvetica; color:red; font-size:1.5em; padding:inherit;’; var […]