Open Source plugin and requires licence

If a plugin is GPL, you have the right to modify, tweak, rebuild, and otherwise hack the plugin at your leisure. You also, under the GPL, have the right to redistribute your modified version and, ultimately, the unmodified version as well. The Gravity Forms license key is for support and updates. If you don’t have … Read more

Changing wp login url without .htaccess

I wrote a post about it a few weeks ago WordPress Easy Login URL without htaccess, but if you don’t want to read that, then here is the code in plugin form: <?php /* Plugin Name: Nice Login URL Plugin URI: http://en.bainternet.info Description: Simple plugin to redirect login/register to a nice url Version: 1.0 Author: … Read more

PHP code on Visual Composer Plugin

So i found the answer with the help of Pieter Goosen and i would like to share it with you: A good method will be to create a Shortcode. To do it, just go to your template Functions.php file and create your function like this example: function shortcode_hello( $atts ){ $time = ( date(‘G’) < … Read more

Change the path where wordpress plugins are uploaded

You can change the Plugins directory using constants defined in wp-config.php: Set WP_CONTENT_DIR to the full local path of this directory (no trailing slash), e.g. define( ‘WP_CONTENT_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-content’ ); Set WP_CONTENT_URL to the full URI of this directory (no trailing slash), e.g. define( ‘WP_CONTENT_URL’, ‘http://example/blog/wp-content’); Set WP_PLUGIN_DIR to the full local path of … Read more

Adding onload to body

And here’s a jQuery solution (as Mike suggested in his first comment). function add_my_scripts() { wp_enqueue_script( ‘jquery’ ); wp_enqueue_script( ‘my_init_script’, SCRIPTSRC, ‘jquery’, ‘1.0’ ); } add_action( ‘init’, ‘add_my_scripts’ ); Then add a script to your plug-in that does this: jQuery.noConflict(); jQuery(document).ready(function($) { init(); }); This will start jQuery in no conflict mode (if it isn’t … Read more

How to tell if Jetpack’s Photon is active?

We just committed a new function to Jetpack Trunk, and it should be enabled in the next release, Jetpack::is_module_active() — http://plugins.trac.wordpress.org/changeset/716884 Then you can just call: if( class_exists( ‘Jetpack’ ) && Jetpack::is_module_active( ‘contact-form’ ) ) {} Or at least, you will once the next version releases, and the user has their Jetpack updated. 🙂 If … Read more

Add a subitem to Woocommerce section

Short answer, use: $args = array(‘show_in_menu’ => ‘woocommerce’); register_post_type(‘my_posttype’, $args); But this won’t give you the custom post type submenus. You can also use add_submenu_page, the code below is just an example: function register_my_custom_submenu_page() { add_submenu_page( ‘woocommerce’, ‘My Custom Submenu Page’, ‘My Custom Submenu Page’, ‘manage_options’, ‘my-custom-submenu-page’, ‘my_custom_submenu_page_callback’ ); } function my_custom_submenu_page_callback() { echo ‘<h3>My … Read more

Add Plugins to WordPress Theme

Let me make a recommendation: do not bundle plugins with your theme! On first glance, yes this is a very easy way to add default functionality with your theme, but there are a slew of reasons not to include the plugins this way: Updates: If the plugin is freely available from WordPress.org already, then so … Read more