Functions
Next Page: next_page_ID($id)
Previous Page: previous_page_ID($id)
$id
: The ID of the page you're trying to get the next or previous page for.
Examples
<?php | |
if (!defined('_PS_VERSION_')) exit; | |
class TD_Shortcode extends Module { | |
protected static $initialized = false; | |
public function __construct() { | |
$this->name = 'td_shortcode'; | |
$this->tab = 'front_office_feature'; |
Functions
Next Page: next_page_ID($id)
Previous Page: previous_page_ID($id)
$id
: The ID of the page you're trying to get the next or previous page for.
Examples
FROM php:7.1-fpm-alpine | |
RUN apk add --update \ | |
autoconf \ | |
g++ \ | |
libtool \ | |
make \ | |
&& docker-php-ext-install mbstring \ | |
&& docker-php-ext-install mysqli \ |
//How to edit a user profile on the front end? | |
//http://wordpress.stackexchange.com/questions/9775/how-to-edit-a-user-profile-on-the-front-end | |
//Forcing nickname as display_name in custom edit profile template | |
//http://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template | |
/////// | |
<?php |
<?php if (($wp_query->current_post +1) == ($wp_query->post_count)) { | |
echo 'This is the last post'; | |
} ?> | |
<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) { | |
echo 'This is the not the last post'; | |
} ?> |
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea> | |
... | |
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea> | |
... | |
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script> | |
<script> | |
// Hook up ACE editor to all textareas with data-editor attribute | |
$(function () { |
You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:
var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }
console.log(getN()); // 5
setN(10);
<?php | |
function prefered_language($available_languages, $http_accept_language) { | |
$available_languages = array_flip($available_languages); | |
$langs = array(); | |
preg_match_all('~([\w-]+)(?:[^,\d]+([\d.]+))?~', strtolower($http_accept_language), $matches, PREG_SET_ORDER); | |
foreach($matches as $match) { | |
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
job "grafana" { | |
datacenters = ["dc1"] | |
type = "service" | |
group "grafana" { | |
count = 1 | |
restart { | |
attempts = 10 | |
interval = "5m" |