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
/* Get user info. */ | |
global $current_user, $wp_roles; | |
//get_currentuserinfo(); //deprecated since 3.1 | |
$post_id = $_GET['post_id']; | |
$user_id = get_current_user_id(); | |
$current_user = wp_get_current_user(); | |
$avatarArr = get_field('avatar', 'user_'. $user_id ); //Using ACF |
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 | |
$args = array( | |
'blog_id' => $GLOBALS['blog_id'], | |
'role' => 'author', | |
'role__in' => array(), | |
'role__not_in' => array(), | |
'meta_key' => '', | |
'meta_value' => '', | |
'meta_compare' => '', | |
'meta_query' => array(), |
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
/* | |
---------- Shortcode for Youtube videos | |
Alan | |
*/ | |
class short_youtube { | |
function shortcode($atts, $content = null) | |
{ | |
extract(shortcode_atts(array( | |
'alinhamento' => '', |
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
/* ---------------- | |
It changes the output HTML of Wordpress default gallery | |
Originally implemented by t31os (Wordpress Stack Exchange) | |
Alan | |
----------------- */ |
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
/* ---------------- | |
This is an inplace message component (not dialog, toaster, snackbar or modal) | |
It must be used with Material UI | |
Usage: | |
<Message | |
type="success" | |
title="Congratulations!" | |
content="Your documents fulfill all the requirements. We'll contact you soon." /> |
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
/* | |
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
It will generate several classes such as: | |
.m-r-10 which gives margin-right 10 pixels. | |
.m-r-15 gives MARGIN to the RIGHT 15 pixels. | |
.m-t-15 gives MARGIN to the TOP 15 pixels and so on. | |
.p-b-5 gives PADDING to the BOTTOM of 5 pixels | |
.p-l-40 gives PADDING to the LEFT of 40 pixels |
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
// ============================================================================= | |
// String Replace | |
// ============================================================================= | |
@function str-replace($string, $search, $replace: '') { | |
$index: str-index($string, $search); | |
@if $index { | |
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); | |
} |
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
$_evento = get_proximos_eventos(1); | |
$evento = $_evento[0]; | |
$unixtimestamp_inicio = strtotime($evento['data_inicio']); | |
echo date_i18n('M', $unixtimestamp_inicio); // Abril | |
// Depending on your blog settings you will see the date displayed in your local format, for example: 15. november 1976. | |
echo date_i18n( get_option( 'date_format' ), strtotime( '11/15-1976' ) ); |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |