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 | |
//Define o prefixo /admin e o namespace Admin (Admin\CategoryController@index) | |
Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function(){ | |
//Separa por group cada item do admin, examplo category | |
Route::group(['prefix' => 'category'], function(){ | |
//os métodos HTTPS que serão chamado os métodos | |
/* | |
ROUTAS: | |
admin/category/all |
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 | |
function wc_add_rest_order_meta( $response, $post, $request ) { | |
foreach( $response->data['line_items'] as $item_id => $line_item ) { | |
if ( ! empty( $line_item['product_id'] ) ) { | |
$product_id = ! empty( $line_item['variation_id'] ) ? $line_item['variation_id'] : $line_item['product_id']; | |
$response->data['line_items'][ $item_id ]['weight'] = get_post_meta( $product_id, '_weight', true ); | |
$response->data['line_items'][ $item_id ]['length'] = get_post_meta( $product_id, '_length', true ); | |
$response->data['line_items'][ $item_id ]['width'] = get_post_meta( $product_id, '_width', true ); |
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 | |
add_action( 'init', function(){ | |
add_action( 'elementor/frontend/section/before_render', function ( \Elementor\Element_Base $element ) { | |
if ( ! $element->get_settings( 'background_video_link' ) ) { | |
return; | |
} | |
$element->set_settings( 'background_video_link', do_shortcode($element->get_settings( 'background_video_link' ) ) ); | |
} ); | |
}); |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@local.projeto.com | |
DocumentRoot "C:/xampp/htdocs/projeto" | |
ServerName local.projeto.com | |
ErrorLog "logs/local.projeto.com-error.log" | |
CustomLog "logs/local.projeto.com--access.log" common | |
<Directory "C:/xampp/htdocs/projeto"> | |
AllowOverride All | |
Require all granted |
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 | |
//Retorna o nome das imagens num array | |
$imagens_do_banco = array('images1.jpg', 'imagens2.jpg'); | |
//Define onde está a pasta das imagens | |
$pasta_da_imagens = 'uploads'; | |
//pega todas as imagens da pasta da imagem | |
$imagens_pastas = glob($pasta_da_imagens."/*.{jpg,png,gif,bmp}", GLOB_BRACE ); |
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 | |
function rastrearObjetoCorreios( $usuario, $senha, $codigo ){ | |
$wsdl = "http://webservice.correios.com.br/service/rastro/Rastro.wsdl"; | |
//@var array - a ser usado com parametro para 1 objeto | |
$data = []; | |
$data['usuario'] =$usuario; | |
$data['senha'] = $senha; |
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 | |
/*Carrega as definições da aplicação*/ | |
//Inicia a sessão | |
session_start(); | |
//Define as credenciais com banco de dados | |
define("DB_DSN", "mysql:host=localhost;dbname=loja"); | |
define("DB_USER", "root"); | |
define("DB_PASS", ""); |
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 | |
/* | |
* Add Product Custom Field in Listing Returning WooCommerce Rest API (Version WC 3.7.1) | |
* Adicionar campo personalizado do produto na listagem retornando API Rest do WooCommerce (Versão WC 3.7.1) | |
*/ | |
function wc_add_rest_line_items( $response, $post, $request ) { | |
foreach( $response->data['line_items'] as $item_id => $line_item ) { |
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 | |
function wc_add_rest_line_items( $response, $post, $request ) { | |
foreach( $response->data['line_items'] as $item_id => $line_item ) { | |
if ( ! empty( $line_item['product_id'] ) ) { | |
$product_id = ! empty( $line_item['variation_id'] ) ? $line_item['variation_id'] : $line_item['product_id']; | |
$meta_key = 'Assigned Field Name'; | |
$meta_key_selected = 'Selected Field Name'; | |
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 | |
class Customer | |
{ | |
private $firstname; | |
private $lastname; | |
public function __construct(array $data = []) | |
{ |