This file contains 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
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts v4.3.2 (token/ERC20/ERC20.sol) | |
pragma solidity ^0.8.0; | |
import "./IERC20.sol"; | |
import "./extensions/IERC20Metadata.sol"; | |
import "../../utils/Context.sol"; | |
/** |
This file contains 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 | |
/////////////////////////////////////////////// | |
// Create a function to handle files sent through ajax | |
function image_wp_handle_upload($file_handler) { | |
require_once( ABSPATH . 'wp-admin/includes/admin.php' ); | |
require_once(ABSPATH . "wp-admin" . '/includes/image.php'); | |
require_once(ABSPATH . "wp-admin" . '/includes/file.php'); |
This file contains 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
/** | |
* permissions request code | |
*/ | |
private final static int REQUEST_CODE_ASK_PERMISSIONS = 1; | |
/** | |
* Permissions that need to be explicitly requested from end user. | |
*/ | |
private static final String[] REQUIRED_SDK_PERMISSIONS = new String[]{ | |
Manifest.permission.CAMERA, |
This file contains 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
// Fix the problem "Installation failed: Could not create directory" when try to install some plugin | |
or make any file changes. | |
// Find WebServer Owner eg: daemon, apache | |
ps aux | egrep '(apache|httpd)' | |
// Give this user ownership to project folder | |
chown -R {WEB_SERVER OWNER} /opt/lampp/htdocs |
This file contains 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 $contador = 0; if( have_rows('produtos_relacionados') ): ?> | |
<?php while ( have_rows('produtos_relacionados') ) : the_row(); ?> | |
<?php $post_object = get_sub_field('produtos'); ?> | |
<?php if( $post_object ): ?> | |
<?php $post = $post_object; setup_postdata( $post ); ?> |
This file contains 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
div::before { | |
background: rgba(0, 0, 0, 0.9) none repeat scroll 0 0; | |
content: ""; | |
height: 100%; | |
left: 0; | |
position: absolute; | |
top: 0; | |
width: 100%; | |
z-index: -1; | |
} |
This file contains 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
<? $httpReferer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null; | |
echo $httpReferer; | |
echo $_SERVER['REDIRECT_URL']; ?> |
This file contains 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
// Por padrão ao digitar uma URL incompleta, o wordpress faz uma busca por algum post ou página | |
com slug similar. Com o snippet abaixo, ele simplesmente redireciona para a página 404 se o termo digitado não existe. | |
function no_redirect_guess_404_permalink( $header ){ | |
global $wp_query; | |
if( is_404() ) | |
unset( $wp_query->query_vars['name'] ); | |
return $header; |
This file contains 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
/* Endpoints */ | |
/* pedidosantigos */ | |
function endChamados() { | |
add_rewrite_endpoint( 'chamados', EP_ROOT | EP_PAGES ); | |
} | |
add_action( 'init', 'endChamados' ); |
This file contains 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( 'the_content', 'my_the_content_filter', 0 ); | |
function my_the_content_filter( $content ) { | |
if (is_single()) { | |
global $post; | |
$meta=get_post_meta($post->ID, 'meta', true); | |
ob_start(); | |
?> | |
<div class="row"> | |
... and the rest of the html | |
... and field you want to add to content |
NewerOlder