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
#!/bin/bash | |
########################## | |
## Check if run as root ## | |
########################## | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
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 | |
// Remove `publish_pulled_post` hook from `syn_pre_pull_posts` filter during cron | |
add_filter( 'syn_pre_pull_posts', 'tenup_dont_publish_pulled_post' ), 100 ); | |
function tenup_dont_publish_pulled_post( $posts ) { | |
// Remove auto publish action | |
if ( class_exists( 'Syndication_WP_XML_Client' ) ) | |
remove_action( 'syn_post_pull_new_post', array( 'Syndication_WP_XML_Client' , 'publish_pulled_post' ), 10, 5 ); |
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 | |
/** | |
* Logged in Home Page Redirect | |
**/ | |
add_action( 'template_redirect', 'pu01_logged_in_homepage' ); | |
// Redirect logged in users from home page to admin | |
function pu01_logged_in_homepage() { | |
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
jQuery( document ).ready( function() { | |
function pu01_show_image() { | |
var pu01_image_1 = jQuery( '#pu01_image_1' ).val(), | |
pu01_image_2 = jQuery( '#pu01_image_2' ).val(), | |
pu01_image_3 = jQuery( '#pu01_image_3' ).val(); | |
jQuery( '#pu01_image_1_preview' ).after( '<div id="pu01_image_1_preview_image"><img width="300" height="140" src="' + pu01_image_1 + '" /></div>' ); | |
jQuery( '#pu01_image_2_preview' ).after( '<div id="pu01_image_2_preview_image"><img width="300" height="140" src="' + pu01_image_2 + '" /></div>' ); |
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
<script> | |
var file_frame; | |
var wp_media_post_id = wp.media.model.settings.post.id; | |
var set_to_post_id = <?php echo get_the_ID(); ?>; | |
jQuery('.upload_image_button').on('click', function( event ){ | |
event.preventDefault(); |
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
/** | |
* Print Selected Thumbnail Images | |
* @return string|bool thumbnail html or false | |
*/ | |
function pU01_thumbnail_img( $size = 'secondary_image', $attr = array() ) { | |
// Fallback to featured image | |
if ( ! $thumbnail_id = get_post_meta( get_the_ID(), get_post_type() . "_{$size}_thumbnail_id", true ) ) { | |
if ( ! $thumbnail_id = get_post_meta( get_the_ID(), "_thumbnail_id", 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 | |
// This will redirect all date based archive to a page that does not exist, | |
// effectively disabling them, with a 404 error code | |
add_action( 'template_redirect', 'pu01_date_archive_not_found' ); | |
function pu01_date_archive_not_found() { | |
if ( is_date() ) { |
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 | |
/** | |
* Simple Metabox Example | |
* | |
* Validates string is under 20 characters | |
* | |
* Copyright (C) 2013 Jeff Sebring <http://jeffsebring.com> | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by |
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
#!/bin/sh | |
wget http://wordpress.org/latest.tar.gz | |
tar -zxvf latest.tar.gz | |
rm latest.tar.gz | |
mv wordpress __ | |
mv __/wp-content _ | |
echo "<?php" >> index.php | |
echo "define( 'WP_USE_THEMES', true );" >> index.php | |
echo "require('./__/wp-blog-header.php');" >> index.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
function js_remove_dashboard_widgets() { | |
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); | |
remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); | |
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); | |
remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' ); | |
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); | |
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); | |
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); | |
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); |
NewerOlder