Skip to content

Instantly share code, notes, and snippets.

View lasida's full-sized avatar
👋
Let's Connect

lasida

👋
Let's Connect
View GitHub Profile
$user = "lsdplugins";
$repo = "lsddonation-mynotif";
$api = " https://api.github.com/repos/$user/$repo/releases";
$headers = [
'Accept' => 'application/vnd.github.v3+json',
];
$payload = [
'timeout' => 30,
@lasida
lasida / class-template-page.php
Created April 29, 2021 11:26
Create Template Page WordPress
Class TemplatePage
{
public function __construct()
{
$this->templates = array();
if ( version_compare( floatval( get_bloginfo( 'version' ) ), '4.7', '<' ) ) {
add_filter('page_attributes_dropdown_pages_args',array( $this, 'register' ));
} else {
add_filter('theme_page_templates', array( $this, 'create' ));
}
@lasida
lasida / wp.editor.js
Created March 18, 2020 10:12
WP Editor API Javascript
// Init Value Editor
var editorID = 'editor-1';
// Init TextArea to WP Editor
wp.editor.initialize(
editorID , {
'tinymce': true,
'quicktags': true,
'mediaButtons' : true,
});
@lasida
lasida / functions.js
Last active December 27, 2019 04:17
WordPress : AJAX
$(document).on('click', '.tour-img, .view-tour', function (e) { //onclick button
$.ajax({
type : "post",
dataType : "json",
url : kmdscrpt.ajaxurl,
data : {
action: "template_tourpackages", //action to Result PHP
post_id : $(this).attr('data-id'), // passing post ID
security: kmdscrpt.security // passing security
},
@lasida
lasida / data.php
Last active July 9, 2019 08:08
Monitoring Penampung Sampah : Menggunakan WEMOS D1, HTTP, PHP, MYSQL
<?php
include('koneksi.php');
$sql = mysqli_query($conn,"SELECT * FROM tb_tes WHERE id=1");
$data = mysqli_fetch_assoc($sql);
?>
<div id="container">
<div id="empty-space"></div>
<h3 style="text-align: center;margin-top: 10%;">Monitoring Ketinggian Penampung Sampah</h3>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char* ssid = "yourNetworkName";
const char* password = "yourNetworkPassword";
void setup () {
Serial.begin(115200);
WiFi.begin(ssid, password);
@lasida
lasida / gist:254197b630b828f48441ded97c35fea6
Created January 28, 2018 10:42
Sum Value by Id Array Multidimensional
<?php
$data = array(
array( '231', 'http://dalamislam.com/akhlaq/amalan-shaleh/cara-agar-tetap-istiqomah-di-jalan-allah', '1'),
array( '231', 'http://dalamislam.com/akhlaq/amalan-shaleh/cara-agar-tetap-istiqomah-di-jalan-allah/', '2'),
array( '231', 'http://dalamislam.com/akhlaq/amalan-shaleh/cara-agar-tetap-istiqomah-di-jalan-allah/amp', '3'),
array( '21221', 'http://dalamislam.com/akhlaq/amalan-shaleh/cara-agar-tetap-istiqomah', '4'),
array( '1', 'http://dalamislam.com/akhlaq/amalan-shaleh/cara-agar-tetap-istiqomah-di-jalan-allah', '5'),
array( '1', 'http://dalamislam.com/akhlaq/amalan-shaleh/cara-agar-tetap-istiqomah-di-jalan-allah/', '10'),
array( '2', 'http://dalamislam.com/akhlaq/amalan-shaleh/cara-agar-tetap-istiqomah-di-jalan-allah/amp', '15'),
@lasida
lasida / functions.js
Last active November 10, 2017 08:45
Ajax View Counter
$(window).load(function() {
$.ajax({
url : kontakin.ajax_url,
type : 'post',
data : {
action : 'add_kontakin_view',
post_id : postID
},
success : function( response ) {
window.location.replace(linkdirection);
<?php
// Elementor Class
if ( ! defined( 'ABSPATH' ) ) exit;
// This file is pretty much a boilerplate WordPress plugin.
// It does very little except including wp-widget.php
class ElementorRecentProduct {
private static $instance = null;
<?php
// Elementor Class
if ( ! defined( 'ABSPATH' ) ) exit;
// This file is pretty much a boilerplate WordPress plugin.
// It does very little except including wp-widget.php
class ElementorRecentProduct {
private static $instance = null;