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 | |
public function bid_tabulation_enqueue_script( $hook ) { | |
global $post; | |
if( $hook == 'post.php' && isset( $post->post_type ) && $post->post_type == 'bid-tabulation' ) { | |
// load script & style | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'jquery-ui-datepicker' ); | |
wp_enqueue_style( 'jquery-ui-datepicker', $GLOBALS['mu_assets_url'] . 'jquery-ui.min.css' ); |
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 | |
// Main namespace | |
namespace Haris\Learn\OONamespace; | |
// Constant | |
const FILE = __FILE__; | |
// Require files | |
require_once dirname(FILE) . '/module-one.php'; |
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 | |
$args = array( | |
'post_type' => 'custom-post', | |
'posts_per_page' => 10, | |
'post_status' => 'publish', | |
'author' => 1, | |
'fields' => 'ids', | |
'tax_query' => array( | |
array( |
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_action('init', 'create_download_page'); | |
public function create_download_page() { | |
global $wp; | |
$home_url = network_home_url(); | |
$download_url = trailingslashit(network_home_url('download')); | |
// current url path | |
$current_path = parse_url(add_query_arg(array()), PHP_URL_PATH); |
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
jQuery(document).ready(function($) { | |
$("#date-start").datepicker({ | |
changeMonth: true, | |
changeYear: true, | |
dateFormat: 'dd/mm/yy', | |
altField: 'input[name="date-start"]', | |
altFormat: 'yymmdd', | |
minDate: new Date(), | |
maxDate: '+2y', | |
onSelect: function(date){ |
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 | |
// display current language | |
if ( defined( 'ICL_LANGUAGE_CODE' ) ) { | |
echo "<pre>Current language code: "; | |
print_r(ICL_LANGUAGE_CODE); | |
echo "</pre>"; | |
} | |
// get all WPML languages |
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
#! /bin/bash | |
while [ "true" ]; do | |
# Do looping. | |
echo "-----------------------------" | |
date -u | |
echo "doing wget.." | |
wget --no-check-certificate -q -O - http://example.com >/dev/null 2>&1 | |
echo "done, sleeping for a minute" | |
sleep 60 |
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
.container { | |
width: 25%; | |
height: 50px; | |
position: relative; | |
} | |
.container .popup { | |
position: absolute; | |
width: 300px; | |
margin-left: 50%; |
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
function write_log($filename, $message, $overwrite = false) { | |
$myfile = fopen($filename, "w") or die("Unable to open file!"); | |
if($overwrite) { | |
$txt = '[' . date("Y-m-d H:i:s") . '] Messages: ' . "\n" . $message; | |
fwrite($myfile, $txt); | |
fclose($myfile); | |
} | |
else { | |
$old_content = file_get_contents($myfile); |
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 | |
// file archive.php | |
set_query_var( 'user_id', absint( $user->ID ) ); | |
get_template_part( 'template-parts/user', 'details' ); | |
// file template-parts/user-details.php | |
var_dump($user_id); |