Articles of plugins

Leverage browser caching not working after updating .htaccess

I have website in WordPress and I updated my .htaccess file with following rule. <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg “access 1 year” ExpiresByType image/jpeg “access 1 year” ExpiresByType image/gif “access 1 year” ExpiresByType image/png “access 1 year” ExpiresByType text/css “access 1 month” ExpiresByType application/pdf “access 1 month” ExpiresByType text/x-javascript “access 1 month” ExpiresByType application/x-shockwave-flash […]

building plugin and it is displaying above plugins page

this is the issue: add_action(‘admin_menu’, ‘bittech_login_settings’); function bittech_login_settings() { add_menu_page(‘BitTech Login Settings’, ‘BitTech Login Settings’, ‘administrator’, ‘bittech_settings’, ‘bittech_login_settings’); $filename = “../wp-content/plugins/bittech_login/include/config.php”; $contents = file_get_contents($filename); if (isset($_POST[‘field’])) { file_put_contents($filename, $_POST[‘field’]); } ?> <form action=”” method=”POST”> <textarea name=”field” cols=”300″ rows=”200″><?php echo $contents; ?></textarea><br> <input type=”submit” value=”Save”> </form> <?php } ?> the code is working correctly but when […]

Delete Associated Media Upon Page / Post Deletion

I found this code. But not work for me. Where to insert the code? I try wp-content/theme/mytheme/functions.php – not work. wp-includes/post.php – not work. wp-includes/functions.php – not work. And I make plugin (but this the first), not work. Plugin download. My WordPress version is 4.2.2. Big Thanks, and sorry I’m rookie!

WooCommerce Variable Product Price – Where is “From” text generated from?

The following code from github will add “- [max price]” to all variable products displayed in product archives. I am wondering how I could also remove the “From” text inside the same filter. add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2); function custom_variation_price( $price, $product ) { $price = ”; if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price […]

Hook to generate a dynamic sitemap with “All in One SEO Pack” Plugin

Besides the urls of posts, pages and categories, I need my site’s sitemap to include the urls of various pages that display data coming from an external source other than the WP database (Rails API). Is there a hook to which I can add a filter so that once Dynamic Sitemap Generation takes place, I […]

View the source code of a 3rd party plugin?

I have added a plugin to my WordPress site. How can I get the source code of this plugin?

Possible to add a language file to a plugin without adding .po/.mo files to plugin directory?

I need to add a language file to an existing plugin. Not for translation reasons, but because I’d like to change all occurrences of a certain word to something else. While I could just drop another .po/.mo file set into the plugin’s languages directory, I don’t want to lose the language file when the plugin […]

I don't understand how this parameter works..?

Ok, I’ve got this simple code for a simple plugin which prepends post titles with the word TESTING.. I’m really unclear how the parameter works here. I understand how parameters work in PHP, but nothing has been passed inside this parameter for WordPress to know the variable is the title.. if that makes sense?? Don’t […]

Dynamic CSS Vs Inline Issues in Code any Way around in a WordPress Themes?

One of my Developer has used this kind of Code to style – <div class=”progress-bar progress-bar-striped custom-color-progress” role=”progressbar” aria-valuenow=”<?php echo $percentage?>” aria-valuemin=”0″ aria-valuemax=”100″ style=”width:<?php echo $percentage * 100?>%”></div> Bu few experts believes that this – style=”width:<?php echo $percentage * 100?>%” looks ultimately hard coded(or Inline CSS in Browser) and is not what one may look […]

Rewrite url without flushing the database?

Is it possible to create a rewrite in WP dynamically such that no flushing is required? For example, not storing the rewrite in the database but rather defined in my plugin code?