Skip to content

Instantly share code, notes, and snippets.

View manchumahara's full-sized avatar
💭
Life is beautiful!

Sabuj Kundu manchumahara

💭
Life is beautiful!
View GitHub Profile
$cache = JFactory::getCache('', 'Output'); //This is how you get the instance of 'Output' cache handler, default is 'Callback' which needs a method to call and it will cache the output of the method, but If you want to cache a variable or an object or array ... like a vbug
$cache->setCaching(1); //force caching as caching can be disabled globally from joomla admin
if ( false === ( $cache_data = $cache->get( 'your_key_here', '' ) ) ) {
// we are here, means there is no data in cache. so let's put something in cache
$cache_data = 'I fucking love Joomla documentation!';
//now cache the data $cache_data
$cache->store($data, 'your_key_here', '' ); //if cache stored
}
//$cache_data is the data we get from cache
var_dump($cache_data);
<?php
if(method_exists('CBXLatestTweetsHelper', 'cbxlatesttweets_display')){
//prepare the params, same params as shortcode
$attr = array();
$attr['username'] = 'codeboxr'; //at least the username param is needed
//call the function to display tweets
CBXLatestTweetsHelper::cbxlatesttweets_display($attr);
function admin_init() {
//register settings sections
foreach ( $this->settings_sections as $section ) {
if ( false == get_option( $section['id'] ) ) {
$section_default_value = $this->getDefaultValueBySection( $section['id'] );
add_option( $section['id'], $section_default_value );
$login_url = wp_login_url();
if(is_singular()){
$login_url = wp_login_url( get_permalink() );;
}
else{
global $wp;
//$login_url = wp_login_url( home_url( $wp->request ) );;
$login_url = wp_login_url( home_url( add_query_arg(array(),$wp->request) ) );;
}
<!--[if lt IE 9]>
<script type='text/javascript' src='assets/js/css3-mediaqueries.min.js?ver=1.0'></script>
<![endif]-->
<!--[if lt IE 9]>
<script type='text/javascript' src='assets/js/html5shiv.min.js?ver=3.7'></script>
<![endif]-->
<!--[if lt IE 9]>
<script type='text/javascript' src='assets/js/html5shiv-printshiv.min.js?ver=3.7'></script>
<![endif]-->
<!--[if lt IE 9]>
@manchumahara
manchumahara / gist:2d3e8d11ba30ca8c0a1960667e412b40
Created February 5, 2018 08:10
Ninja Forms - Get all form IDs and Names https://codeboxr.com/
$forms_modified = array();
if ( get_option( 'ninja_forms_load_deprecated', false ) ) {
$forms = Ninja_Forms()->forms()->get_all();
foreach ( $forms as $form_id ) {
$forms_modified[ $form_id ] = Ninja_Forms()->form( $form_id )->get_setting( 'form_title' );;
}
} else {
$forms = Ninja_Forms()->form()->get_forms();
if(class_exists('CBXWPBookmarkHelper')){
//get total bookmark count for category by category id $cat_id
$bookmark_category_count = CBXWPBookmarkHelper::getTotalBookmarkByCategory($cat_id);
}
[title]Example of different shortcodes[/title]
[margin]
[content]<strong>Button shortcode</strong>[/content]
[button url="http://themeboxr.com" type="defaul" text="Default"] [button url="http://themeboxr.com" type="primary" text="Primary"] [button url="http://themeboxr.com" type="success" text="Success"] [button url="http://themeboxr.com" type="info" text="info"] [button url="http://themeboxr.com" type="warning" text="Warning"] [button url="http://themeboxr.com" type="danger" text="Danger"]
[margin]
[content]<strong> Alerts shortcode</strong>[/content]
[alert type="info" text="This is Alert Info"] [alert type="success" text="This is Alert Success"] [alert type="danger" text="This is Alert Danger "]
https://codeboxr.com/product/cbx-wordpress-ready-mix/
https://wordpress.org/plugins/cbxwpreadymix/
Team: [cbxwpreadymix_team]
Possible Params:
[cbxwpreadymix_team column="4" hide_designation="show" hide_social="show" count="9" order="DESC" orderby='title']
column default value '3' possible values 1-12
hide_designation default 'show' possible values show, hide
hide_social default 'show' possible values show, hide