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 | |
/* | |
* Impede o acesso de assinantes ao wp-admin e os redireciona para página específica do front end | |
* Prevents subscribers access to wp-admin and redirects to specific page of the front end | |
*/ | |
function gfs_restrict_admin_with_redirect() { | |
if ( ! current_user_can( 'edit_posts' /* edit_posts = minimum capacity required to access the dashboard */ ) && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { | |
wp_redirect( site_url() . '/?p=322' ); // 322 = Page ID to redirect | |
exit; |
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 | |
// Custom Avatar via Advanced Custom Fields Image Upload | |
add_filter( 'get_avatar' , 'gofas_custom_avatar', 1, 5 ); | |
function gofas_custom_avatar( $avatar, $id_or_email, $size, $default, $alt ) { | |
$image_object = get_field('your_image_field_id', 'user_'.$id_or_email); | |
$image_size = 'thumbnail'; | |
$acf_avatar = $image_object['sizes'][$image_size]; // Configure ACF Image to return Image Object | |
if ( $image_object ) { | |
$avatar = $acf_avatar; // ACF Avatar | |
$avatar = "<img alt='{$alt}' src='{$avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; |
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
wget -r -P / --user-agent="" -e robots=off --wait 1 -E http://website.com |
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 | |
/* | |
Author: Mauricio Gofas | |
Author URL: https://www.gofas.com.br | |
*/ | |
// Custom Avatar via Gravity forms upload field | |
add_filter( 'get_avatar' , 'gfca_custom_avatar' , 1 , 5 ); | |
function gfca_custom_avatar( $avatar, $id_or_email, $size, $default, $alt ) { | |
$current_user = wp_get_current_user(); | |
$gfca_avatar = $current_user->your_custom_profile_image; |
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 | |
/** | |
* Change text strings | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function my_text_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Sale!' : | |
$translated_text = __( 'Clearance!', 'woocommerce' ); |
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 | |
/** | |
* Change text strings | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function my_text_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Related Products' : | |
$translated_text = __( 'Check out these related products', 'woocommerce' ); |
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
global $wp; | |
$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) ); |
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_action( 'init', 'custom_remove_footer_credit', 10 ); | |
function custom_remove_footer_credit () { | |
remove_action( 'storefront_footer', 'storefront_credit', 20 ); | |
add_action( 'storefront_footer', 'custom_storefront_credit', 20 ); | |
} | |
function custom_storefront_credit() { | |
?> | |
<div class="site-info"> |
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
echo do_shortcode("[shortcode]"); |
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( 'manage_posts_columns', 'revealid_add_id_column', 5 ); | |
add_action( 'manage_posts_custom_column', 'revealid_id_column_content', 5, 2 ); | |
function revealid_add_id_column( $columns ) { | |
$columns['revealid_id'] = 'ID'; | |
return $columns; | |
} | |
function revealid_id_column_content( $column, $id ) { |