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 | |
/** | |
* Display SVG in attachment modal | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
function bodhi_svgs_response_for_svg( $response, $attachment, $meta ) { |
This file has been truncated, but you can view the full file.
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
;FLAVOR:RepRap | |
;TIME:4609 | |
;Generated with Cura_SteamEngine 2.3.1 | |
M190 S60 | |
M104 S195 | |
M109 S195 | |
G21 ;metric values | |
G90 ;absolute positioning | |
M82 ;set extruder to absolute mode | |
M107 ;start with the fan off |
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
/** | |
* See this on CodePen.io - http://codepen.io/brettshumaker/pen/NbzGjR | |
*/ | |
jQuery(document).ready(function($) { | |
// Rating starts as a value out of 100 - 87/100 | |
// You may need to adjust this depending on your data source | |
var myRating = 87; | |
// This is just generic code to place the rating HTML into a container |
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']; | |
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 | |
// 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 | |
// 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
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
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
<?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 |