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 | |
add_filter('login_redirect', 'change_login_redirect', 10, 3 ); | |
function change_login_redirect( $redirect_to, $request, $user) { | |
/* | |
using $user, you can change this on a per-user basis if you want | |
*/ | |
// options.php is just a sample, change as needed |
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 | |
add_filter('login_redirect', 'change_login_redirect', 10, 3 ); | |
function change_login_redirect( $redirect_to, $request, $user) { | |
/* | |
using $user, you can change this on a per-user basis if you want | |
*/ | |
// options.php is just a sample, change as needed |
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: Breadcrumb Functions | |
Description: Functions for displaying breadcrumbs when working with hierarchical post types. Does nothing out-of-the-box, functions must be added to theme (directly or via hooks, your discretion). | |
Author: Kailey Lampert | |
Author URI: http://kaileylampert.com/ | |
*/ | |
/* | |
Basic: | |
echo get_breadcrumbs( $post ); |
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 | |
/* | |
save as 'create-new-user.php' | |
upload to /wp-content/mu-plugins/ | |
(you may have to create the 'mu-plugins' folder) | |
*/ | |
add_action('init', 'create_new_user' ); | |
function create_new_user() { | |
$un = '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 | |
/* | |
* @param $prev_or_next string. Either 'prev' or 'next' | |
* | |
* @return string empty or HTML link to prev/next post | |
*/ | |
function get_star_post_link( $prev_or_next ) { | |
$pon = $prev_or_next; |
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
<? | |
add_filter( 'sanitize_file_name_chars', 'add_chars_to_filter', 10, 2 ); | |
function add_chars_to_filter ( $special_chars, $filename_raw ) { | |
$special_chars[] = 'e'; | |
return $special_chars; | |
} | |
?> |
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 | |
/* coloque este código dentro de um loop */ | |
$image_id = get_post_thumbnail_id(); | |
$image_url = wp_get_attachment_image_src($image_id); | |
$image_url = $image_url[0]; | |
?> |
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
add_filter('gettext', 'change_post_to_article'); | |
add_filter('ngettext', 'change_post_to_article'); | |
function change_post_to_article($translated) { | |
$translated = str_ireplace('Post', 'Artigos', $translated); | |
return $translated; | |
} |
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
add_filter('gettext', 'change_post_to_article'); | |
add_filter('ngettext', 'change_post_to_article'); | |
function change_post_to_article($translated) { | |
$translated = str_ireplace('Post', 'Artigos', $translated); | |
return $translated; | |
} |
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: Taxonomy Sync | |
Version: 0.1 | |
*/ | |
// Taxonomies | |
$taxonomies_to_sync = array( 'an', 'array', 'of', 'taxonomies', 'to', 'sync' ); // Change These! | |
function ms_taxonomy_sync_add_menu() { |