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
jQuery(function ($){
// alert('helo rentalist')
})
<?php
/*
Plugin Name: Rentalist
Description: Create a plugin with sub menu and script.js jquery included with ajax admin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
<?php
if ( isset( $_REQUEST['rentalist_setting_save'] )
&& isset( $_REQUEST['rentalist_setting'] )
&& $_REQUEST['rentalist_setting'] != '' ) {
do_action( 'rentalist_save_settings', $_POST );
}
echo '<div class="wrap">';
if ( isset( $_SESSION['vap_cfg_msg_status'] ) && $_SESSION['vap_cfg_msg_status'] ) {
<?php
class RT_Settings {
function __construct() {
add_action( "rentalist_save_settings", array( $this, "rentalist_save_settings_func" ), 10, 1 );
}
function rentalist_save_settings_func( $params = array() ) {
if ( isset( $params['rentalist_setting'] ) && $params['rentalist_setting'] != '' ) {
<?php
/*
Plugin Name: Rentalist
Description: Create a plugin with sub menu and script.js jquery included with ajax admin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
<?php
/*
Plugin Name: Our Plugin Menu
Description: Adding Sub menu in admin
Version: 1.0
Author: Bam
Author URI: https://wpenginer.com
*/
if ( ! defined( 'ABSPATH' ) ) {
function wpenginer_custom_rest(){
register_rest_field('post', 'authorName', array(
'get_callback' => function() {return get_the_author();}
));
}
add_action('rest_api_init', 'wpenginer_custom_rest');
wp_localize_script('wptail', 'wpenginerData', array(
'root_url' => get_site_url(),
'nonce' => wp_create_nonce('wp_rest')
));
@wolfcoder
wolfcoder / video-ads.css
Created June 16, 2021 05:52
style for video ads
#video-ads-insert {
width: 100%;
height: 100%;
position: absolute;
z-index: 1000;
color: #FFF;
background: #FFF;
text-align: center
}
@wolfcoder
wolfcoder / video-ads.js
Created June 16, 2021 05:50
script js for controling behavior
jQuery(document).ready(function () {
jQuery('#play-ad').click(
function () {
jQuery('#play-ad').remove();
jQuery('#ad-will-end, #skip-ad').show();
let adLimit = 5;
let adDuration = 24;
document.getElementById('wayang-ad').play();