Skip to content

Instantly share code, notes, and snippets.

View kreativan's full-sized avatar

Ivan Milincic kreativan

View GitHub Profile
@kreativan
kreativan / wordpress_cpt_admin_columns.php
Created March 13, 2024 10:10
Wordpress Custom Post Types - Admin Columns
<?php
/**
* Admin Columns
* @example
*
new Admin_Columns('my_post_type', [
'order' => __('Order'),
'image' => __('Image'),
]);
@kreativan
kreativan / reCaptcha-Ajax-Submit.js
Last active May 10, 2024 07:25
Google reCaptcha php Class
const formSubmitRecapcha = function (site_key = "") {
grecaptcha.ready(function () {
grecaptcha.execute(site_key, {
action: 'contact'
}).then(function (token) {
// Get #recaptchaResponse field and populate it's value
var recaptchaResponse = document.getElementById('recaptchaResponse');
recaptchaResponse.value = token;
//
// Make the Ajax Call