Skip to content

Instantly share code, notes, and snippets.

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

Dragi Postolovski dragipostolovski

🏠
Working from home
View GitHub Profile
@dragipostolovski
dragipostolovski / widget-random-post.php
Last active March 22, 2021 10:29
How to Create a WordPress Custom Widget
<?php
class PE_Random_Post extends WP_Widget {
public function __construct() {
// actual widget processes
parent::__construct(
'pe_random_post', // Base ID
'Random Post', // Name
array( 'description' => __( 'Display random post in sidebar widget.', 'projectsengine' ), ) // Args
<?php
function pe_custom_post_product() {
$labels = array(
'name' => _x( 'Products', 'post type general name' ),
'singular_name' => _x( 'Product', 'post type singular name' ),
'add_new' => _x( 'Add New', 'book' ),
'add_new_item' => __( 'Add New Product' ),
'edit_item' => __( 'Edit Product' ),
'new_item' => __( 'New Product' ),
<?php
// Wrap two adjacent elements in a containing div using jQuery.
function pe_load_js() {
?>
<script type='text/javascript'>
jQuery(document).ready(function ($) {
$("#billing_customer_age_field span input").each(function(index) {
<?php
/**
* Projects Engine
*
* @copyright Copyright (C) 2021-2021, Projects Engine - contact@projectsengine.com
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher
*
* @wordpress-plugin
* Plugin Name: Projects Engine
* Version: 1.9.2
<?php
/**
* PE_Elementor class.
*
* @category Class
* @package PEElementor
* @subpackage WordPress
* @author Dragi Postolovski <contact@projectsengine.com>
* @copyright 2021 Dragi Postolovski
<?php
// We check if the Elementor plugin has been installed / activated.
if ( ! in_array( 'elementor/elementor.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
return;
}
/**
* Include the widgets and create a custom category.
*
<?php
use Elementor\Controls_Manager;
use Elementor\Group_Control_Background;
use Elementor\Plugin;
use Elementor\Widget_Base;
if ( ! defined( 'ABSPATH' ) ) {
// Exit if accessed directly.
exit;
<?php
use Elementor\Controls_Manager;
use Elementor\Group_Control_Background;
use Elementor\Plugin;
use Elementor\Widget_Base;
if ( ! defined( 'ABSPATH' ) ) {
// Exit if accessed directly.
exit;
// WordPress
jQuery(document).ready(function ( $ ) {
let payment = $('#your-button');
// let secureFields = new SecureFields();
let styles = {
// your style goes here
// Specific Style for Each Element
cardNumber: "border: 1px solid #eaeaea; height: 40px; padding: 10px; " +