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 | |
/* Register custom post types on the 'init' hook. */ | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 0.1.0 | |
* @access public |
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
/** | |
* Return a timestamp with the format "m/d/yy h:MM:ss TT" | |
* @type {Date} | |
*/ | |
function timeStamp() { | |
// Create a date object with the current time | |
var now = new Date(); | |
// Create an array with the current month, day and time |
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
// shortcode: [demo-form] | |
function demo_form_shortcode( $atts ) { | |
$name = ''; | |
$email = ''; | |
$company = ''; | |
$errors = array(); | |
if ( isset( $_POST['demo_form_submitted'] ) |
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
// Remove classes that have given prefix | |
// Example: | |
// You have an element with classes "apple juiceSmall juiceBig banana" | |
// You run: | |
// $elem.removeClassPrefix('juice'); | |
// The resulting classes are "apple banana" | |
// NOTE: discussion of implementation techniques for this, including why simple RegExp with word boundaries isn't correct: | |
// http://stackoverflow.com/questions/57812/jquery-remove-all-classes-that-begin-with-a-certain-string#comment14232343_58533 |
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
/** | |
* Additional registration checks. | |
* | |
* This filter is documented in wp-includes/user.php | |
*/ | |
function my_registration_errors( $errors, $sanitized_user_login, $user_email ) { | |
if ( strlen( $sanitized_user_login ) < 5 ) { | |
$errors->add( 'username_too_short', __( '<strong>ERROR</strong>: Username must be at least 5 characters.' ) ); | |
} | |
return $errors; |
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 | |
/** | |
* Plugin Name: Theme Screenshot Inheritance | |
* Description: Child themes without screenshots inherit their parent theme's screenshot. | |
* | |
* Drop this in the /plugins or /mu-plugins directory. | |
*/ | |
/** | |
* Add parent screenshot to child theme. |
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
/** | |
* Retrieve category list in either HTML list or custom format. | |
* This is a copy of the native `get_the_category_list` function. | |
* | |
* @global WP_Rewrite $wp_rewrite | |
* | |
* @param string $separator Optional, default is empty string. Separator for between the categories. | |
* @param string $parents Optional. How to display the parents. | |
* @param int|bool $post_id Optional. Post ID to retrieve categories. | |
* @return string |
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
/** | |
* A shortcode to display the number of testimonials. | |
* | |
* For Strong Testimonials plugin. | |
* | |
* For all: [my_testimonial_count] | |
* For a specific category (by slug): [my_testimonial_count category="abc"] | |
* | |
* @param $atts | |
* @param null $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
<?php | |
/** | |
* Add a link to the Plugins menu to show active plugins. | |
* | |
* Add this, without the <?php line above, to your (child) theme's functions.php. | |
* If using Admin Menu Editor plugin, you will need to reposition link manually. | |
*/ | |
function my_ui_plugins_active() { | |
global $submenu; | |
$submenu['plugins.php'][6] = array( __( 'Active Plugins' ), 'activate_plugins', 'plugins.php?plugin_status=active' ); |
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
/* | |
Document : sc_our_services_admin | |
Created on : Jun 25, 2014, 10:07:44 PM | |
Author : Bilal | |
Description: | |
Purpose of the stylesheet follows. | |
*/ | |
root { | |
display: block; |
OlderNewer