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 | |
| 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 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 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 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
| 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: [''] | |
| }; |
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 | |
| $repo_collection = \Tainacan\Repositories\Collections::get_instance(); | |
| $repo_items = \Tainacan\Repositories\Items::get_instance(); | |
| $repo_metadata = \Tainacan\Repositories\Metadata::get_instance(); | |
| $acervo = $repo_collection->fetch_one( ['pagename' => 'acervo'] ); | |
| $unidade = $repo_metadata->fetch_one( ['name' => 'Unidade'] ); | |
| $item = new \Tainacan\Entities\Item( 7200 ); |
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 migrate_user_role_custom_network() { | |
| $users = get_users( ['role' => 'custom_network'] ); | |
| foreach ( $users as $user ) { | |
| $user->set_role( 'editor' ); | |
| $user->set_role( 'custom_network' ); | |
| } | |
| } |
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 get_vote_count ( $post_id ) { | |
| $args = [ | |
| 'post_type' => 'vote', | |
| 'fields' => 'ids', | |
| 'meta_query' => [ | |
| [ | |
| 'key' => 'voting_id', |
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 | |
| namespace MeuPlugin; | |
| $voting_page = apply_filters( 'voting_page', 'create-voting' ); | |
| define( 'MEUPLUGIN_VOTING_PAGE', $voting_page ); | |
| function add_rewrite() | |
| { | |
| add_rewrite_rule('^concordamos/' . CONCORDAMOS_VOTING_PAGE . '/?', 'index.php?voting_page=1', 'top'); |
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
| p1_eixo | |
| p12_uf | |
| p16_bairro | |
| p16_cidade | |
| p16_estado | |
| p16_internacional | |
| p16_nacional | |
| p17_ano | |
| p18_agrario | |
| p18_comunicacao |
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 filter_excerpt_more( $more ) { | |
| global $post; | |
| if ( is_front_page() ) { | |
| if ( ! ( 'deputado' == $post->post_type ) ) { | |
| return $more; |