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
CREATE TABLE IF NOT EXISTS `wpidea_cbcustompostmeta` ( | |
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
`post_id` bigint(20) unsigned NOT NULL DEFAULT '0', | |
`component` varchar(255) DEFAULT NULL, | |
`meta_key` varchar(255) DEFAULT NULL, | |
`meta_value` longtext, | |
PRIMARY KEY (`meta_id`), | |
KEY `post_id` (`post_id`), | |
KEY `meta_key` (`meta_key`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
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
CREATE TABLE IF NOT EXISTS `j32_user_profiles` ( | |
`user_id` int(11) NOT NULL, | |
`profile_key` varchar(100) NOT NULL, | |
`profile_value` varchar(255) NOT NULL, | |
`ordering` int(11) NOT NULL DEFAULT '0', | |
UNIQUE KEY `idx_user_id_profile_key` (`user_id`,`profile_key`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Simple user profile storage table'; |
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
global $post, $current_user; | |
get_currentuserinfo(); | |
if(current_user_can( 'edit_others_posts', $post->ID ) || ($post->post_author == $current_user->ID)) { | |
//show edit link | |
} |
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
/* | |
We are requesting for 46,66,80,128,237,247,272,285 | |
Available The codes are: | |
11 - Group created. | |
12 - Event created. | |
46 - Status update. * | |
56 - Post on Timeline from another user. |
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('getarchives_where', 'getarchives_where_author'); | |
add_filter('month_link', 'month_link_author'); | |
/** | |
* Custom function to filter query for author archive widget, this works on author page only | |
* | |
* @param $where | |
* @return string | |
*/ | |
function getarchives_where_author($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 | |
$fonts = '<div class="row"> | |
<div class="col-md-4 col-sm-6 col-lg-3"> | |
<i class="fa fa-fw"></i> | |
fa-glass | |
<span class="muted">(&#xf000;)</span> | |
</div> | |
<div class="col-md-4 col-sm-6 col-lg-3"> |
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('user_search_columns', 'user_search_columns_bd' , 10, 3); | |
function user_search_columns_bd($search_columns, $search, $this){ | |
//if(!in_array($search_columns, 'display_name')){ | |
if(!in_array('display_name', $search_columns)){ | |
$search_columns[] = 'display_name'; | |
} | |
return $search_columns; | |
} |
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 | |
$last_changed = wp_cache_get( 'last_changed', 'posts' ); | |
if ( ! $last_changed ) { | |
$last_changed = microtime(); | |
wp_cache_set( 'last_changed', $last_changed, 'posts' ); | |
} | |
global $wpdb; |
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
Old way: | |
$option = JRequest::getCmd('option'); | |
New way: | |
$app = JFactory::getApplication(); | |
$option = $app->input->getCmd('option', ''); |
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
//old way | |
$app = JFactory::getApplication(); | |
$offline = $app->getCfg('offline'); | |
or | |
$config =& JFactory::getConfig(); | |
echo 'Site name is ' . $config->getValue( 'config.sitename' ); | |
//New way | |
//use get() |
OlderNewer