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 | |
$posts = get_posts( array( | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'posts_per_page' => -1 | |
) ); | |
foreach ($posts as $key => $value) { | |
$post_id = wp_insert_post( array( | |
'post_type' => 'new_post_type' |
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 | |
$menu_items = wp_get_nav_menu_items('Menu Principal'); // PEGA TODOS OS ITENS DO Menu Principal | |
$menu_mobile = array(); | |
foreach ( $menu_items as $key => $value ) { // SEPARA OS ITENS EM SUBMENUS | |
if ( !is_array( $menu_mobile[$value->menu_item_parent] ) ) { | |
$menu_mobile[$value->menu_item_parent] = array(); | |
} | |
array_push( $menu_mobile[$value->menu_item_parent], $value ); | |
} | |
?> |
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
cat file.txt | tr "\n" " " | sed "s/<tag>.*<\/tag>//" |
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
<div class="wrap"> | |
<h1 class="wp-heading-inline">Inscritos</h1> | |
<hr class="wp-header-end"> | |
<ul class="subsubsub"> | |
<li class="all"><a href="edit.php?post_type=banner&all_posts=1" class="current">Tudo <span class="count">(5)</span></a> |</li> | |
<li class="mine"><a href="edit.php?post_type=banner&author=1">Meus <span class="count">(3)</span></a> |</li> | |
<li class="publish"><a href="edit.php?post_status=publish&post_type=banner">Publicados <span class="count">(5)</span></a></li> | |
</ul> |
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
Shift + Ctrl + A ( Select HTML tag and content ) |
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
#commentform > p.comment-form-author input, | |
#commentform > p.comment-form-email input, | |
#commentform > p.comment-form-url input, | |
#commentform > p.comment-form-comment textarea {display: block; width: 100%; padding: .5rem .75rem; font-size: 1rem; line-height: 1.25; color: #464a4c; background-color: #fff; background-image: none; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid rgba(0,0,0,.15); border-radius: .25rem; -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; } | |
#commentform > p.comment-form-author, | |
#commentform > p.comment-form-email, | |
#commentform > p.comment-form-url, | |
#commentform > p.comment-form-comment {m |
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
INSERT INTO database1.table | |
SELECT * FROM database2.table |
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
useradd -m username |
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 | |
add_filter( 'woocommerce_product_categories_widget_args', 'fn_woocommerce_product_categories_widget_args' ); | |
function fn_woocommerce_product_categories_widget_args( $args ) { | |
$args['exclude'] = array( '1','2','3' ); | |
return $args; | |
} |
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 | |
//* Redirect WordPress Logout to Home Page | |
add_action( 'wp_logout', create_function( '', 'wp_redirect( home_url() ); exit();' ) ); |