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 | |
function closestLowerHigherNr($array, $nr) { | |
sort($array); | |
$re_arr = array('lower'=>min(current($array), $nr), 'higher'=>max(end($array), $nr), 'closest'=>$nr); | |
foreach($array AS $num){ | |
if($nr > $num) $re_arr['lower'] = $num; | |
else if($nr <= $num){ | |
$re_arr['higher'] = $num; | |
break; | |
} |
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_action( 'show_user_profile', 'my_show_extra_profile_fields' ); | |
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' ); | |
function my_show_extra_profile_fields( $user ) { ?> | |
<h3>Extra profile information</h3> | |
<table class="form-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
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
class CacheJsController extends Controller | |
{ |
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 | |
// Create A class Helper as app/Helper/Helper.php | |
use Illuminate\Support\Facades\Request; | |
Class Helper { | |
public static function getBodyClass() { | |
$body_classes = [ ]; | |
$class = ""; |
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 | |
/** | |
* | |
* @wordpress-plugin | |
* Plugin Name: Attachment custom fields | |
* Plugin URI: http://uditrawat.com | |
* Description: Custom fields for Attachments | |
* Version: 10.3 | |
* Author: Udit Rawat | |
* Author URI: http://uditrawat.com |
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 | |
/** | |
* | |
* @wordpress-plugin | |
* Plugin Name: Custom Tags For Master Slider | |
* Plugin URI: http://uditrawat.com | |
* Description: Custom Tags For Master Slider | |
* Version: 1.3 | |
* Author: Udit Rawat |
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 | |
// get_posts in same custom taxonomy | |
$postlist_args = array( | |
'posts_per_page' => -1, | |
'orderby' => 'menu_order title', | |
'order' => 'ASC', | |
'post_type' => 'your_custom_post_type', | |
'your_custom_taxonomy' => 'your_custom_taxonomy_term' | |
); | |
$postlist = get_posts( $postlist_args ); |
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 ($) { | |
"use strict"; | |
function $fixBootstrapModalPosition() { | |
$(this).css('display', 'block'); | |
var $dialog = $(this).find(".modal-dialog"), | |
offset = ($(window).height() - $dialog.height()) / 2, | |
bottomMargin = parseInt($dialog.css('marginBottom'), 10); | |
// Make sure you don't hide the top part of the modal w/ a negative margin if it's longer than the screen height, and keep the margin equal to the bottom margin of the modal | |
if(offset < bottomMargin) offset = bottomMargin; |
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 | |
/** | |
* | |
* @wordpress-plugin | |
* Plugin Name: Custom Post Filter | |
* Plugin URI: http://uditrawat.com | |
* Description: Custom Post Filter For Posts | |
* Version: 1.3 | |
* Author: Udit Rawat | |
* Author URI: http://uditrawat.com |
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
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
font-family: arial; | |
} | |
table { | |
border: 1px solid #ccc; |
OlderNewer