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
mysql -e "SELECT c.post_title, c.post_content FROM wp_posts a, wp_postmeta b LEFT JOIN wp_posts c ON c.ID = b.meta_value WHERE a.post_type = 'nav_menu_item' AND b.meta_key = '_menu_item_object_id' AND a.ID = b.post_id ORDER BY a.menu_order" -u wp -pwp diso --xml > test.xml | |
sed -i -e $'s/</\</g' test.xml | |
sed -i -e $'s/>/\>/g' test.xml | |
sed -i -e $'s/"/\'/g' test.xml | |
sed -i -e $'s/&/\&/g' test.xml | |
sed -i -e $'s/<!--[^>]*>//g' test.xml | |
sed -i -e $'s/<a[^>]*>//g' test.xml | |
sed -i -e $'s/<img[^>]*>//g' test.xml | |
sed -i -e $'s/<\/a>//g' test.xml | |
sed -i -e $'s/ id=\'[^\']*\'//g' test.xml |
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 | |
$the_query = new WP_Query( array( | |
'post_type' => 'items', | |
'tax_query' => array( | |
array ( | |
'taxonomy' => 'washu_ppi_items_types', | |
'field' => 'slug', | |
'terms' => 'apartments', | |
) | |
), |
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
sed -i '' -e $'s/</\</g' Diso\ v2.html && sed -i '' -e $'s/>/\>/g' Diso\ v2.html && sed -i '' -e $'s/"/\'/g' Diso\ v2.html |
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
function gcap() { | |
git add . && git commit -m "$*" && git push | |
} | |
#bug | |
function gbug() { | |
gcap "🐛 BUG: $@" | |
} | |
#improvement | |
function gimp() { | |
gcap "↗️ IMPROVEMENT: $@" |
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( 'PPI_FOR_EXPORT', 1 ); | |
$a = get_pages(); | |
foreach( $a as $b ) { | |
$f = $b->ID; | |
$c = get_post_field( 'post_content', $f ); | |
remove_filter('the_content', 'wpautop'); | |
$d = apply_filters( 'the_content', $c ); | |
$my_post = array( |
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
SELECT | |
a.post_title title, | |
a.post_content content | |
FROM | |
(SELECT | |
m.post_title, | |
m.post_content, | |
m.ID, | |
m.post_parent, | |
m.menu_order as self_order, |
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
global $ppi_query; | |
... | |
$ppi_query = new WP_Query( $args ); | |
... | |
global $ppi_query; | |
global $post; | |
if ( $ppi_query ==null ) { $ppi_query = $wp_query; } |
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
require_once( WASHU_PPI_PLUGIN_DIR . 'templates/partials/ppi-loop.php' ); | |
... | |
require( WASHU_PPI_PLUGIN_DIR . 'templates/partials/' . get_post_type() . '.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
add_filter( 'template_include', array( self::$instance, 'ppi_load_single_template' ), 99 ); | |
... | |
function ppi_load_single_template( $template ) { | |
... | |
if ( is_singular( 'things' ) ) { | |
// look in child or parent themes for template files first | |
if ( $theme_template = locate_template( 'single-items.php' ) ) { | |
$template = $theme_template; | |
} else { | |
$template = self::$directories['templates'] . 'single-items.php'; |
NewerOlder