Plugin Deactivate Self on Activation Errors
You may need to have this line in your code require_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); The plugin.php file is not automatically included.
You may need to have this line in your code require_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); The plugin.php file is not automatically included.
What if you use: <div class=”fill” style=”background-image: url(<?php echo get_stylesheet_directory_uri();?>/img/image01.png);”></div> You need to tell WordPress in “a WordPress-way” where to find the image… Look in codex at get_stylesheet_directory_uri().
Well another solution would be to use wp_add_inline_style() which affords you an opportunity to inject dynamic inline styles: function my_custom_style() { wp_enqueue_style( ‘custom-style’, get_template_directory_uri() . ‘/css/custom-style.css’ ); //our customer percentage set by a user in some options panel $percentage = get_theme_mod(‘my-custom-percentage’); $inline_style =<<<DOC .progress-bar { width: {$percentage}%; } DOC; //inject our custom percentage after “custom-style.css” … Read more
By default WP is very reluctant to show or display any errors. That’s inline with its strategy of “dumbing down” things of sorts. The configuration I use to monitor for errors is along the lines of this in wp-config.php: define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG_DISPLAY’, false ); @ini_set( ‘display_errors’,’Off’ ); @ini_set( ‘log_errors’,’On’ ); @ini_set( ‘error_log’,’/home/user/logs/php_site_name.log’ … Read more
You can always read through the documentation that WordPress.org has put together on Creating A Network. The point below was taken from Step 1: “Also deactivate all active plugins. You can reactivate them again after the network is created.” After the network is created I recommend activating your Plugins one by one and testing your … Read more
WP loads jQuery in no conflict mode so shortcut $ is not available for jQuery to use .You should not use the $ variable for jQuery within WordPress. jQuery(function ($) { //code here }) or (function($){ //code here })(jQuery); There are so many Q&A which refers to the same conflict issue.Check this and this.
Now what if you have to add/remove fields from default contact form to change the feel of your comment box? I am eliminating website field from default comment box by playing with ‘fields’ argument:in comments.php <?php $comment_args = array(‘title_reply’ => ‘Got Something To Say:’, ‘fields’ => apply_filters(‘comment_form_default_fields’, array( ‘author’ => ‘<p class=”comment-form-author”>’ . ‘<label for=”author”>’ … Read more
The string given by $plugin_path is used as an array key for $wp-plugin_paths, this is pretty standard behaviour in setting an array so it can be accessed later, to retrieve $plugin_realpath via $wp_plugin_paths[$plugin_path]. If you want to see how it all comes out you can do: add_action(‘init’,’print_plugin_paths’); function print_plugin_paths() { global $wp_plugin_paths; foreach ($wp_plugin_paths as … Read more
You could filter the include paths returned by get_included_files by removing any files from the list that are not in your theme (and/or child theme) directory: function get_theme_includes() { $includedfiles = get_included_files(); // normalize theme paths for matching $styledir = str_replace(“\\”,”https://wordpress.stackexchange.com/”,get_stylesheet_directory()); $templatedir = str_replace(“\\”,”https://wordpress.stackexchange.com/”,get_template_directory()); $i = 0; // loop included files foreach ($includedfiles as $includedfile) … Read more
It’s a bad idea because woocommerce has about 20 translations. In that case you have to translate the modified text domains, or if they don’t the 50% of woocommerce will be english, but I want spanish.