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($) { | |
jQuery.fn.cleardefault = function() { | |
return this.focus(function() { | |
if( this.value == this.defaultValue ) { | |
this.value = ""; | |
} | |
}).blur(function() { | |
if( !this.value.length ) { | |
this.value = this.defaultValue; |
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 | |
/** | |
* post-process.php | |
* make sure to include post-process.php in your functions.php. Use this in functions.php: | |
* | |
* get_template_part('post-process'); | |
* | |
*/ | |
function do_insert() { | |
if( 'POST' == $_SERVER['REQUEST_METHOD'] |
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 to add a fake component to BuddyPress. A registered component is needed to add notifications | |
function custom_filter_notifications_get_registered_components( $component_names = array() ) { | |
// Force $component_names to be an array | |
if ( ! is_array( $component_names ) ) { | |
$component_names = array(); | |
} | |
// Add 'custom' component to registered components 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
/** | |
* Register Custom myCRED Hook | |
* @since 1.0 | |
* @version 1.0 | |
*/ | |
add_filter( 'mycred_setup_hooks', 'Learndash_myCRED_Hook' ); | |
function Learndash_myCRED_Hook( $installed ) { | |
$installed['hook_learndash'] = array( | |
'title' => __( 'LearnDash', 'mycred' ), |
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 custom_filter_notifications_publish_post_get_registered_components( $component_names = array() ) { | |
// Force $component_names to be an array | |
if ( ! is_array( $component_names ) ) { | |
$component_names = array(); | |
} | |
// Add 'custom' component to registered components array | |
array_push( $component_names, 'custom' ); | |
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 member list filtered by profile fields | |
function member_list_by_profile_fields( $atts ) { | |
global $bp, $wpdb; | |
$atts = shortcode_atts( array( | |
'id' => '1', | |
'YOURFIELDNAME' => 'default-value' // this can be just a number! check in bp profile field settings with inspector tool ;) | |
), $atts, 'member_list_by_profile_fields' ); |
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('um_profile_tabs', 'resume_pages_tab', 1000 ); | |
function resume_pages_tab( $tabs ) { | |
$user_id = um_profile_id(); // or get the current user id | |
$user_data = get_userdata( $user_id ); | |
$user_roles = $user_data->roles; | |
if( in_array( 'employer', $user_roles ) ) { // match user role | |
unset($tabs['resume']); // remove tabs | |
} | |
return $tabs; |
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 listify_get_job_listing_price_job_id( $job_id ) { | |
global $wpdb; | |
$order_itemmeta_sql = 'SELECT * FROM ' . | |
$wpdb->prefix . 'woocommerce_order_itemmeta WHERE | |
meta_key ="_job_id" AND meta_value=' .$job_id; | |
$order_itemmeta_results = $wpdb->get_row( $order_itemmeta_sql , OBJECT ); | |
$order_items_sql = 'SELECT * FROM ' . | |
$wpdb->prefix . 'woocommerce_order_items WHERE |
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 | |
/* | |
* Virtual Themed Page class | |
* | |
* This class implements virtual pages for a plugin. | |
* | |
* It is designed to be included then called for each part of the plugin | |
* that wants virtual pages. | |
* | |
* It supports multiple virtual pages and content generation functions. |
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
# DRUPAL-TO-WORDPRESS CONVERSION SCRIPT | |
# Changelog | |
# 10.02.2012 - Updated by Kelly Dwan !! THIS VERSION HAS NOT BEEN TESTED !! | |
# 07.29.2010 - Updated by Scott Anderson / Room 34 Creative Services http://blog.room34.com/archives/4530 | |
# 02.06.2009 - Updated by Mike Smullin http://www.mikesmullin.com/development/migrate-convert-import-drupal-5-to-wordpress-27/ | |
# 05.15.2007 - Updated by D’Arcy Norman http://www.darcynorman.net/2007/05/15/how-to-migrate-from-drupal-5-to-wordpress-2/ | |
# 05.19.2006 - Created by Dave Dash http://spindrop.us/2006/05/19/migrating-from-drupal-47-to-wordpress/ |
OlderNewer