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 | |
// Adds tiny MCE editor to excerpt | |
function tinymce_excerpt_js(){ | |
$post_type= get_post_type(); | |
if ($post_type != "shop_order") {?> | |
<script type="text/javascript"> | |
jQuery(document).ready( tinymce_excerpt ); | |
function tinymce_excerpt() { | |
jQuery("#excerpt").addClass("mceEditor"); | |
tinyMCE.execCommand("mceAddControl", false, "excerpt"); |
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 is essentially what I have adding the post meta field, not doing this from the edit post screen. | |
$name_meta['first-name'] = "Joe"; | |
$name_meta['middle-name'] = "D."; | |
$name_meta['last-name'] = "Schmoe"; | |
$name_meta['suffix'] = "Jr."; | |
update_post_meta($post->ID, '_staff_member_name', $name_meta); | |
// update_post_meta automatically serializes the array when adding it to the database |
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 sortable columns | |
function sortable_column_func(){ | |
return array( | |
'my_sortable_variable' => 'my_sortable_variable', | |
); | |
} | |
add_filter("manage_edit-POST_TYPE_NAME_sortable_columns", "sortable_column_func"); |
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
$(document).ready(function() { | |
var isNextOn = true; | |
var isPrevOn = false; | |
var showIt = function() { | |
if ($(this).css('opacity').value !== 0 || $(this).css('opacity').value != 1) { | |
$(this).stop(); | |
$(this).css('opacity', 0); | |
} | |
$(this).animate({ | |
opacity: 1 |
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 | |
/** | |
* Gets and displays paginated Vimeo videos from a Vimeo channel. | |
* Replace 'YOUR_CHANNEL_NAME' with the channel you want to pull from. | |
* | |
* Accepts 4 Values and Returns 1 | |
* | |
* @param string $channel_name Name of the Vimeo channel | |
* @param array $excluded_videos Array of video ID's to exclude from the output |
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 add_show_inc_file_widget() { | |
wp_add_dashboard_widget('included-files', 'Show Included Theme Files', 'show_included_theme_files'); | |
} | |
add_action('wp_dashboard_setup', 'add_show_inc_file_widget' ); | |
function show_included_theme_files(){ | |
$included_files = get_included_files(); | |
foreach ($included_files as $filename) { | |
if (strpos($filename, "THEME-FOLDER-NAME")) echo $filename."<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
This tells you pretty much everything you need to know about how to begin writing your WordPress plugin. | |
http://codex.wordpress.org/Writing_a_Plugin | |
Go here to actually submit your plugin for review. | |
http://wordpress.org/plugins/add/ | |
WordPress plugins are updated via SVN and it can be tricky at first. | |
http://wordpress.org/plugins/about/svn/ | |
This Mac app can help keep you out of the command line if you're not comfortable there. |
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 | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
); | |
$posts_loop = new WP_Query( $args ); | |
if ( $posts_loop->have_posts() ) : | |
// Initialize Output | |
$output = ''; |
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_filter( 'edd_remote_license_check_response', 'bsgist_add_data_to_license_check', 10, 3 ); | |
function bsgist_add_data_to_license_check( $json, $args, $license_id ) { | |
$price_id = get_post_meta( $license_id, '_edd_sl_download_price_id', true ); | |
$download_id = edd_software_licensing()->get_download_id( $license_id ); | |
$download_variable_prices = get_post_meta($download_id, 'edd_variable_prices', true); | |
$json['account_level'] = $download_variable_prices[$price_id]['name']; | |
OlderNewer