Articles of plugins

Conditionally bypass plugin

I would like to defer the loading of an othervise active plugin for certain pages. Since all plugins reside in the same folder, and WordPress only loads the activated ones, it must have an array of active plugin-handles at some point that it goes through. There’s probably even a filter available to modify this array […]

WordPress logo upload option in theme panel

Hello every one i am facing one issue in adding logo option in my theme panel of wordpress i am using this code function logo_display() { ?> <input type=”file” name=”logo” /> <?php echo get_option(‘logo’); ?> <?php } function handle_logo_upload() { if(!empty($_FILES[“demo-file”][“tmp_name”])) { $urls = wp_handle_upload($_FILES[“logo”], array(‘test_form’ => FALSE)); $temp = $urls[“url”]; return $temp; } return […]

Reset WordPress website

I have a website to demo plugins, and I want to allow users to login, but I am not sure how to reset the website once they log out. Is there a way to create a separate instance of WordPress for each new user and then delete itself once that user logs out? Or is […]

Show HTML form before WordPress plugin deletion

I want to show interface to admin on plugin deletion, having choices (radio buttons) with a question – “Please let us know why are you deleting the plugin?” I know about register_uninstall_hook but I cannot use HTML code in it.

Add get_option to jquery

I have created a settings page that contains various radio button options for a custom plugin. A radio button I’ve created is to ‘display dots’ with the values yes or no. I can get use the value any other time except in the jQuery function below. I would like to get the value of the […]

admin_notices hook show message all admin pages after plugin activate

I am working on a plugin and in plugin i use admin_notices hook for showing my custom message. When a user activate plugin the message show blew the plugin activate successfully, but my message shows all the other admin pages. I want to show message only the plugins page after plugin activate or my plugin […]

Shortcode to generate and save password in a file

I have the following shortcode: // Add Shortcode function custom_shortcode_phptest() { function generatePassword($length = 6) { $characters = ‘0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’; $charactersLength = strlen($characters); $pass = ”; for ($i = 0; $i < $length; $i++) { $pass .= $characters[rand(0, $charactersLength – 1)]; } return $pass; } $password = generatePassword(); $data = time(); $test = ‘/home/blablabla/public_html/ot/docs/test/’ . $password […]

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!