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
| #!/usr/bin/env bash | |
| # | |
| # Nginx - new server block | |
| # Functions | |
| ok() { echo -e "\033[1;32m$1 ✔ \033[0m"; } | |
| die() { echo -e "\033[1;31m$1 ✖ \033[0m"; exit 1; } | |
| # Variables | |
| USER=$1 |
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
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.php$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule . /index.php [L] | |
| </IfModule> | |
| # END 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 | |
| function sendWithPhpMailer($subject, $body, $reply) { | |
| require(ABSPATH . WPINC . '/class-phpmailer.php'); | |
| require(ABSPATH . WPINC . '/class-smtp.php'); | |
| // date_default_timezone_set( 'America/Sao_Paulo' ); | |
| $blogname = wp_strip_all_tags( trim( get_option( 'blogname' ) ) ); | |
| $smtpHost = wp_strip_all_tags( trim( get_option( 'smtp_host' ) ) ); |
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] | |
| ;;;;;;;;;;;;;;;;;;; | |
| ; About php.ini ; | |
| ;;;;;;;;;;;;;;;;;;; | |
| ; PHP's initialization file, generally called php.ini, is responsible for | |
| ; configuring many of the aspects of PHP's behavior. | |
| ; PHP attempts to find and load this configuration from a number of locations. |
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_action( 'rest_api_init', 'theme_register_rest_fields' ); | |
| function theme_register_rest_fields() { | |
| register_rest_field( 'post', 'comments', array( | |
| 'get_callback' => 'theme_get_post_comments', | |
| 'update_callback' => null, | |
| 'schema' => null | |
| )); | |
| } |
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 | |
| define('POST_VIEWS_KEY', 'post_views_count'); | |
| function addMetaPostViews( $_postID, $_count = 0 ) { | |
| delete_post_meta( $_postID, POST_VIEWS_KEY ); | |
| add_post_meta( $_postID, POST_VIEWS_KEY, $_count ); | |
| } | |
| function hasViews( $_postID ) { |
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 | |
| /* | |
| * show wp_mail() errors | |
| */ | |
| add_action( 'wp_mail_failed', 'onMailError', 10, 1 ); | |
| function onMailError( $wp_error ) { | |
| echo '<pre>' . print_r($wp_error , true ) . '</pre>'; | |
| } |
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
| .modal | |
| font-family: inherit | |
| position: fixed | |
| z-index: 10000 | |
| &__overlay | |
| position: fixed | |
| top: 0 | |
| left: 0 | |
| right: 0 | |
| bottom: 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
| <?php | |
| function about_metabox_page () { | |
| $hasGetMethod = (isset($_GET['post']) && !empty($_GET['post'])); | |
| $hasPostMethod = (isset($_POST['post_ID']) && !empty($_POST['post_ID'])); | |
| $about_pages_arr = array( | |
| 'sobre', | |
| 'sobre-nos', | |
| 'sobre-a-grgit', | |
| 'quem-somos', |
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 | |
| $services_post_type = new Odin_Post_Type( | |
| 'Service', | |
| 'services' | |
| ); | |
| $services_post_type->set_labels( | |
| array( | |
| 'name' => __( 'Services', 'odin' ), |