Skip to content

Instantly share code, notes, and snippets.

View gasatrya's full-sized avatar
🏠
Working from home

Ga Satrya gasatrya

🏠
Working from home
View GitHub Profile
@gasatrya
gasatrya / fetch_plugin.js
Created October 17, 2022 18:34 — forked from cwhittl/fetch_plugin.js
Using Fetch with Wordpress Plugins Ajax
fetch(ajax_url, {
method: 'POST',
credentials: 'same-origin',
headers: new Headers({'Content-Type': 'application/x-www-form-urlencoded'}),
body: 'action=zget_profile_user'
})
.then((resp) => resp.json())
.then(function(data) {
if(data.status == "success"){
_this.setState({loaded:true,user:data.user});
@gasatrya
gasatrya / wpmudev-forminator-editor-access.php
Created October 12, 2022 13:57 — forked from wpmudev-sls/wpmudev-forminator-editor-access.php
[Forminator] Grants Full Acesses For Editor Role. This plugin allows users with the editor role to have full access (view and save) to the Forminator administrative pages.
<?php
/**
* Plugin Name: [Forminator] Grants Full Access For Editor Role.
* Plugin URI: https://premium.wpmudev.org/
* Description: This plugin allows users with the editor role to have full access (view and save) to the Forminator administrative pages.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* Task: 0/11289012348292/1169742392170370
* License: GPLv2 or later
*
@gasatrya
gasatrya / wsl2-ubuntu-lamp.md
Created August 8, 2022 14:13 — forked from abobija/wsl2-ubuntu-lamp.md
LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

Apache

sudo apt-get update && sudo apt-get upgrade 
sudo apt-get install -y apache2

PHP

@gasatrya
gasatrya / forminator-load-cpt-select-field.php
Created July 18, 2022 12:51 — forked from wpmudev-sls/forminator-load-cpt-select-field.php
[Forminator] Load custom posts on Select Field and get IDs on the on-change event.
<?php
/**
* Plugin Name: [Forminator] Load custom posts on Select Field and get IDs on the on-change event.
* Plugin URI: https://wpmudev.com/
* Description: With the ID retrieved on the "on change" event, you can write your custom code to get the post data and fill the correspondent fields on the form, more details about how to do it on the comment of this snippet.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://wpmudev.com/
* Task: SLS-3568
* License: GPLv2 or later
*
@gasatrya
gasatrya / rel.php
Last active December 17, 2015 03:58 — forked from corsonr/Add rel attribute to wordpress gallery
Add rel attribute to WordPress gallery
<?php
add_filter('wp_get_attachment_link', 'rc_add_rel_attribute');
function rc_add_rel_attribute($link) {
global $post;
return str_replace('<a href', '<a rel="prettyPhoto[pp_gal]" href', $link);
}
?>