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
{ | |
"If Simples": { | |
"prefix": "ifs", | |
"body": [ | |
"if ( $1 ) {", | |
"$2", | |
"}" | |
], | |
"description": "Imprime uma condição if simples" | |
}, |
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 | |
/** | |
* Plugin Name: Plugin Template | |
* Plugin URI: https://site.com.br | |
* Description: Plugin description. | |
* Version: 0.0.1 | |
* Requires at least: 5.2 | |
* Requires PHP: 7.2 | |
* Author: The dev/ | |
* Author URI: https://site.com.br |
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
/*! | |
* Understrap v1.1.0 (https://understrap.com) | |
* Copyright 2013-2022 The UnderStrap Authors (https://github.com/understrap/understrap/graphs/contributors) | |
* Licensed under GPL (http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) | |
*/ | |
(function (factory) { | |
typeof define === 'function' && define.amd ? define(factory) : | |
factory(); | |
})((function () { 'use strict'; |
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( 'wp_loaded', function() { | |
function list_hook_callbacks( $hook_name ) { | |
global $wp_filter; | |
if ( ! isset( $wp_filter[$hook_name] ) ) { | |
return []; | |
} |
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
{ | |
"format": { | |
"description": "Format the code using WP coding standards", | |
"prompt": "Formate o código selecionado seguindo as melhores práticas (coding standards) propostas pelo WordPress, independente da linguagem usada.", | |
"context": { | |
"selection": 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 | |
if ( !function_exists( 'is_rest' ) ) { | |
/** | |
* Checks if the current request is a WP REST API request. | |
* | |
* Case #1: After WP_REST_Request initialisation | |
* Case #2: Support "plain" permalink settings and check if `rest_route` starts with `/` | |
* Case #3: It can happen that WP_Rewrite is not yet initialized, | |
* so do this (wp-settings.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
<?php | |
if ( ! function_exists( 'get_post_by_name' ) ) { | |
function get_post_by_name($name, $post_type = 'post') { | |
$get_posts = get_posts( | |
[ | |
'post_status' => 'publish', | |
'post_type' => $post_type, | |
'posts_per_page' => 1, | |
'name' => $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 | |
namespace MetaToFeaturedImage; | |
/** | |
* Plugin Name: Meta to featured image | |
* Description: Migrate image of the post meta to featured image | |
* Version: 0.0.1 | |
* Requires at least: 5.8 | |
* Requires PHP: 7.0 |
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 exclude_posts_by_filter_field( $query ) { | |
// Add other checks to determine exactly where you want to remove posts | |
if ( isset( $query->query['s'] ) && ! empty( $query->query['s'] ) ) { | |
// Continue if post_type equal `post` | |
if ( isset( $query->query['post_type'] ) && 'post' === $query->query['post_type'] ) { | |
$parts = explode( ' ', $query->query['s'] ); |
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
const handleSubmitBackup = () => { | |
// Definindo os detalhes do usuário que você quer criar | |
let rand = Math.floor(Math.random() * 999) | |
let userData = { | |
username: 'jane-'+rand, | |
password: 'secret', | |
email: 'jane-'+rand+'@example.com', | |
roles: [''] | |
}; |
NewerOlder