Skip to content

Instantly share code, notes, and snippets.

View wordpress-lab's full-sized avatar

Wordpress Blog wordpress-lab

  • Dhaka
View GitHub Profile
@wordpress-lab
wordpress-lab / custom-control-init.php
Created August 13, 2019 13:41 — forked from iqbalrony/custom-control-init.php
Create Elementor Custom Control.
<?php
namespace ElementorControls;
if (!defined('ABSPATH')) exit; // Exit if accessed directly
class Elementor_Custom_Controls {
public function includes() {
require_once(plugin_dir_path(__FILE__).'inc/elementor/image-selector-control.php');
}
@iqbalrony
iqbalrony / custom-css.php
Last active November 22, 2023 11:56
How to add custom css control with elementor free version.
<?php
use Elementor\Controls_Manager;
use Elementor\Element_Base;
use Elementor\Core\Files\CSS\Post;
use Elementor\Core\DynamicTags\Dynamic_CSS;
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
@Golpha
Golpha / Readme.md
Last active December 17, 2022 16:48
PHP Object-hacks without Reflections: Injectors and Closure Binding References

PHP Object-hacks without Reflections

Sometimes it is needed to manipulate private and protected properties of instances. The common way to do this is to manipule the visibility of the targeted properties using class reflection, but there is a more memory and performance efficient way to accomplish this task.

Reading and writing private and protected properties using injectors

At first injectors are not standardized nor described along design patterns, i choose Injectors as the name for this mechanic because of their major usage. The explicit technical name could be: IO-Adapters for invisible properties. Injectors do use closure binding with a explicit class scope. So, whatever you want to modify does require knowledge about the implementation details of the targeted parameters, as you should have when directly using closure binding.

The Injector class