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 | |
/** | |
* Customize WordPress Toolbar | |
* | |
* @param obj $wp_admin_bar An instance of the global object WP_Admin_Bar | |
*/ | |
function myplugin_customize_toolbar( $wp_admin_bar ){ | |
$user = wp_get_current_user(); | |
if ( ! ( $user instanceof WP_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 | |
/** | |
* Remove WordPress Toolbar for subscribers | |
*/ | |
function myplugin_remove_admin_bar() { | |
if ( ! current_user_can( 'publish_posts' ) ) { | |
show_admin_bar( false ); | |
} | |
} | |
add_action( 'plugins_loaded', 'myplugin_remove_admin_bar' ); |
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
<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 | |
/** | |
* @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 |
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
array( | |
array( | |
'key' => 'field_name', | |
'value' => 'field_value', | |
'type' => 'field_type', | |
'compare' => 'logic_operator' | |
) | |
) |