This file contains 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 | |
/** | |
* Redirect user after successful login. | |
* | |
* @param string $redirect_to URL to redirect to. | |
* @param string $request URL the user is coming from. | |
* @param object $user Logged user's data. | |
* @return string | |
*/ | |
function frontend_login_redirect( $redirect_to, $request, $user ) { |
This file contains 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 | |
/** | |
* Print an extra field into the login form | |
* | |
* @link https://codex.wordpress.org/Plugin_API/Action_Reference/login_form | |
*/ | |
function my_login_extra_field() { | |
?> | |
<p> | |
<label for="rd"><?php _e( 'Take me to' ); ?></label> |
This file contains 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 | |
/** | |
* Redirect user on login. | |
* | |
* @param string $redirect_to URL to redirect to. | |
* @param string $request URL the user is coming from. | |
* @param object $user Logged user's data. | |
* @return string | |
* | |
* @link https://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect |
This file contains 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 | |
/** | |
* Replace default login logo with custom image | |
* | |
* @link https://codex.wordpress.org/Plugin_API/Action_Reference/login_head | |
*/ | |
function my_login_logo() { | |
echo '<style type="text/css">.login h1 a { background-image:url('. get_stylesheet_directory_uri() .'/imgs/super_wp.png); }</style>'; | |
} | |
add_action('login_head', 'my_login_logo'); |
This file contains 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
<h1> | |
<a href="https://wordpress.org/" title="Powered by WordPress" tabindex="-1">Example WordPress website</a> | |
</h1> |
This file contains 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 | |
$keys = array( | |
'error', | |
'm', | |
'p', | |
'post_parent', | |
'subpost', | |
'subpost_id', | |
'attachment', | |
'attachment_id', |
This file contains 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 | |
/** | |
* Register custom query vars | |
* | |
* @param array $vars The array of available query variables | |
* | |
* @link https://codex.wordpress.org/Plugin_API/Filter_Reference/query_vars | |
*/ | |
function myplugin_register_query_vars( $vars ) { | |
$vars[] = 'key1'; |
This file contains 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 | |
/** | |
* Build a custom query | |
* | |
* @param $query obj The WP_Query instance (passed by reference) | |
* | |
* @link https://codex.wordpress.org/Class_Reference/WP_Query | |
* @link https://codex.wordpress.org/Class_Reference/WP_Meta_Query | |
* @link https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts | |
*/ |
This file contains 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 | |
/** | |
* @package notify | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Notify Me | |
Plugin URI: http://wordpress.org/extend/plugins/# | |
Description: This is an example plugin fo ioProgrammo readers | |
Author: Carlo Daniele |