Skip to content

Instantly share code, notes, and snippets.

View wolfcoder's full-sized avatar
💭
Full Stack Developer

Bams wolfcoder

💭
Full Stack Developer
View GitHub Profile
<?php
global $vap, $vap_settings;
if( isset( $_REQUEST['vap_setting_save'] ) && isset( $_REQUEST['vap_setting'] ) && $_REQUEST['vap_setting'] != '' ) {
do_action( 'vap_save_settings', $_POST );
}
echo '<div class="wrap vap_content">';
if( isset( $_SESSION['vap_cfg_msg_status'] ) && $_SESSION['vap_cfg_msg_status'] ) {
<?php
if( !class_exists ( 'VAP_Settings' ) ) {
class VAP_Settings {
function __construct(){
add_action( "vap_save_settings", array( $this, "vap_save_settings_func" ), 10 , 1 );
add_action( 'wp_ajax_vap_setting_dellastsync', array( $this, 'vap_setting_dellastsync' ) );
<?php
/*
Plugin Name: VIN Articles Post
Plugin URI: https://www.vinpractice.com/
Description: Sync / import CDP articles from VIN Api
@wolfcoder
wolfcoder / vap_admin_js.js
Created June 8, 2022 05:39
VIN article js
var vapSyncCategories = [];
var vapAllSuccess = true;
var vapRunning = false;
function vapGetCategoryArticles(categoryIndex, pageIndex) {
var post_data = {
action: 'vap_sync_start',
on_sync: true,
category_id: vapSyncCategories[categoryIndex].id,
category_wpid: vapSyncCategories[categoryIndex].wpid,
@wolfcoder
wolfcoder / vap_sync.class.php
Created June 8, 2022 05:38
VIN article syn class
<?php
if( !class_exists ( 'VAP_Sync' ) ) {
class VAP_Sync {
function __construct() {
$vap_settings = get_option( 'vap_setting' );
$this->api_url = isset( $vap_settings['vap_api_url'] ) ? $vap_settings['vap_api_url'] : '';
@wolfcoder
wolfcoder / rt_sync.class.php
Created June 7, 2022 10:55
inject new category to wordpress with json data
<?php
class RT_Sync {
function __construct() {
$rt_settings = get_option( 'rentalist_setting' );
$this->api_url = isset( $rt_settings['rt_api_url'] ) ? $rt_settings['rt_api_url'] : '';
$this->api_key = isset( $rt_settings['rt_api_key'] ) ? $rt_settings['rt_api_key'] : '';
$this->project_id = isset( $rt_settings['rt_project_id'] ) ? $rt_settings['rt_project_id'] : '';
@wolfcoder
wolfcoder / case-study-form-login.php
Created June 6, 2022 02:52
form proccesing with cookie
<?php
// cek apakah form telah di submit
if (isset($_POST["submit"])) {
// form telah disubmit, proses data
// ambil nilai form
$username = htmlentities(strip_tags(trim($_POST["username"])));
$password = htmlentities(strip_tags(trim($_POST["password"])));
// siapkan variabel untuk menampung pesan error
@wolfcoder
wolfcoder / vap_settings.class.php
Last active June 4, 2022 13:01
add_action( 'wp_ajax_vap_setting_dellastsync', array( $this, 'vap_setting_dellastsync' ) ); call function wp admin plugin through ajax jquery https://prnt.sc/zskgPlNPVRu_
<?php
if( !class_exists ( 'VAP_Settings' ) ) {
class VAP_Settings {
function __construct(){
add_action( "vap_save_settings", array( $this, "vap_save_settings_func" ), 10 , 1 );
add_action( 'wp_ajax_vap_setting_dellastsync', array( $this, 'vap_setting_dellastsync' ) );
@wolfcoder
wolfcoder / vinarticlepost_plugin.php
Created June 4, 2022 12:43
call function wp admin plugin through ajax jquery
<?php
/*
Plugin Name: VIN Articles Post
Plugin URI: https://www.vinpractice.com/
Description: Sync / import CDP articles from VIN Api
@wolfcoder
wolfcoder / vap_admin_js.js
Created June 4, 2022 12:41
call function wp admin plugin through ajax jquery
var vapSyncCategories = [];
var vapAllSuccess = true;
var vapRunning = false;
function vapGetCategoryArticles(categoryIndex, pageIndex) {
var post_data = {
action: 'vap_sync_start',
on_sync: true,
category_id: vapSyncCategories[categoryIndex].id,
category_wpid: vapSyncCategories[categoryIndex].wpid,