Last active
March 14, 2018 11:34
-
-
Save webmaster007/95569a5cbe049501a98c95f214181e36 to your computer and use it in GitHub Desktop.
WP-Search-Username - Wordpress plugin - Description = Typ the username and find the author page from the author that you looking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== WP Search Username === | |
Plugin name: WP Search Username | |
Plugin URI: https://www.wordpress.org/plugins/wp-search-username/ | |
Version: 1.0 | |
Author: Robin Grasmeijer | |
Donate link: | |
Tags: search, username, author, display name, posts, custom posts, products, category, wordpress, post | |
Requires at least: 3.5 | |
Tested up to: 4.9 | |
Stable tag: 2.3.4 | |
Search every username from the author in your Wordpress site. | |
== Description == | |
Search every username in your Wordpress site from the author. Make the WP Search Username Widget active in your Widgets menu from your Wordpress site. | |
Or place the below shortcode in your Wordpress site page content: | |
[search-username] | |
Or place the php shortcode in your themes file with a FTP Program. You can find the normal and php shortcode in your shortcodes.txt file. | |
Option author page with FTP: | |
Only if you have not a author.php page in your themes then you can upload the author.php page from your plugin directory with a FTP program and save it up your pc directory. And upload it to your themes /wp-content/themes/your-theme-name/ directory with a FTP Program. | |
== Installation == | |
= Uploading in WordPress Dashboard = | |
1. Navigate to the 'Add New' in the plugins dashboard | |
2. Navigate to the 'Upload' area | |
3. Select `wp-search-username.zip` from your computer | |
4. Click 'Install Now' | |
5. Activate the plugin in the Plugin dashboard | |
= Using FTP = | |
1. Download `wp-search-username.zip` | |
2. Extract the `wp-search-username` directory to your computer | |
3. Upload the `wp-search-username` directory to the `/wp-content/plugins/` directory | |
4. Activate the plugin in the Plugin dashboard | |
== Screenshots == | |
5 Screenshots in the assets directory. | |
== Changelog == | |
== Upgrade Notice == | |
= 1.0 = | |
Initial release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== WP Search Username === | |
Plugin name: WP Search Username | |
Plugin URI: https://www.wordpress.org/plugins/wp-search-username/ | |
Version: 1.0 | |
Author: Robin Grasmeijer | |
Donate link: | |
Tags: search, username, author, display name, posts, custom posts, products, category, wordpress, post | |
Requires at least: 3.5 | |
Tested up to: 4.9 | |
Stable tag: 2.3.4 | |
Search every username from the author in your Wordpress site. | |
== Description == | |
You can place the below shortcode in your Wordpress site page content: | |
[search-username] | |
Or place the below php shortcode in your themes file with a FTP Program: | |
<?php | |
// Use shortcode in a PHP - WP Search Username echo do_shortcode( '[search-username]' ); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WP Search Username | |
Plugin URI: https://www.wordpress.org/plugins/wp-search-username/ | |
Description: Find the username from the author in your WordPress site. | |
Version: 1.0 | |
Author: Robin Grasmeijer | |
Author URI: http://wordpress.com/ | |
Text Domain: WP Search Username | |
*/ | |
add_action( 'wp_enqueue_scripts', 'wp_search_username_scripts' ); | |
// use widgets_init action hook to execute custom function | |
add_action( 'widgets_init', 'wpsu_searchusernamewidget_register_widgets' ); | |
//register our widget | |
// constructor | |
function wpsu_searchusernamewidget_register_widgets() { | |
register_widget( 'wpsu_searchusername_widget' ); | |
} | |
//wpsu_searchusername_widget class | |
class wpsu_searchusername_widget extends WP_Widget { | |
//process the new wp search username widget | |
// new constructor | |
function __construct() { | |
$widget_ops = array( | |
'classname' => 'wpsu_searchusernamewidget_widget_class', | |
'description' => ' ' | |
); | |
parent::__construct( 'wpsu_searchusername_widget', 'WP Search Username Widget', $widget_ops ); | |
} | |
//build the wp search username widget settings form | |
function form($instance) { | |
$defaults = array( 'title' => 'Search Username' ); | |
$instance = wp_parse_args( (array) $instance, $defaults ); | |
$title = $instance['title']; | |
?> | |
<p>Title: <input class="widefat" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p> | |
<?php | |
} | |
//save the wp search username widget settings | |
function update($new_instance, $old_instance) { | |
$instance = $old_instance; | |
$instance['title'] = strip_tags( $new_instance['title'] ); | |
return $instance; | |
} | |
//display wp search username the widget | |
function widget($args, $instance) { | |
extract($args); | |
echo $before_widget; | |
$title = apply_filters( 'widget_title', $instance['title'] ); | |
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; | |
//display search username form | |
wpsu_search_form(); | |
echo $after_widget; | |
} | |
} | |
add_action( 'pre_get_posts', 'wpsu_searchusername_query' ); | |
//Builds the wp search username form | |
function wpsu_search_form(){ | |
?> | |
<form role="search" method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> | |
<label class="screen-reader-text" for="s"><h2><?php _x( 'Search Username', 'label' ); ?></h2></label> | |
<input type="text" id="author" name="q=author&author_name" value="" placeholder="Search for ..."> | |
<input type="submit" value="Search" /> | |
</form> | |
<?php | |
} | |
// WP Shortcode to display WP search username form on any page or post. | |
function wpsu_form_creation(){ | |
?> | |
<form role="search" method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"><br> | |
<label class="screen-reader-text" for="s">Search Username: </label> | |
<input type="text" id="author" name="q=author&author_name" value="" placeholder="Search for ..."> | |
<input type="submit" value="Search" /> | |
</form><br> | |
<?php | |
} | |
add_shortcode('search-username', 'wpsu_form_creation'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is my plugin 'wp-search-username'. Make a directory 'wp-search-username' and add the files in the directory 'wp-search-username'. And upload it to your plugin directory from your Wordpress site. And make it activate. You can find the author page from every user if you type the username from a author.