agentsclimarketplace

Elementor widget development

Skill randhoy/agent-skills-pack/skills/wp/elementor-widget-development

Install
npx -y skills add randhoy/agent-skills-pack --skill elementor-widget-development

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Engineer Elementor widgets for any WordPress project. Use for control modeling, frontend rendering, editor preview parity, selector logic, and widget-level dependency loading.

SKILL.md

3.7 KB, 816 tokens by cl100k_base, as published. Nobody here has run it

Elementor Widget Development

Core (Universal)

Trigger Scope

Use this skill when the task is widget internals:

  • building/refactoring widget classes
  • mapping controls to visual output
  • fixing render() and content_template() mismatch
  • optimizing widget-specific JS/CSS dependencies

Workflow

  1. Define widget contract.
  • required identity methods
  • control model with explicit defaults
  1. Implement control surface.
  • section structure
  • responsive and conditional behavior
  1. Implement frontend rendering.
  • deterministic output from sanitized settings
  • explicit output escaping
  1. Implement editor rendering.
  • mirror frontend intent in content_template()
  • keep branch parity where possible
  1. Verify behavior.
  • empty/default/custom states
  • editor/frontend parity

Control And Selector Patterns

  • Prefer {{WRAPPER}}-scoped selectors for style controls.
  • Use control placeholders by data shape:
  • {{VALUE}} for scalar controls (text/color/select/switcher).
  • {{SIZE}}{{UNIT}} for slider-like controls.
  • {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} for dimensions.
  • {{URL}} for media/url bindings.
  • For repeater rows, use the row _id and {{CURRENT_ITEM}}-style targeting patterns.

Output Escaping & Sanitization

Apply context-appropriate escaping when rendering user-provided values:

ContextFunctionExample
HTML attributeesc_attr()<div class="{{ $settings['css_class'] }}">esc_attr( $settings['css_class'] )
Raw HTML tagswp_kses_post()Rich text editor output
Plain text (HTML context)esc_html()<p>{{ $settings['title'] }}</p>esc_html( $settings['title'] )
URL hrefesc_url()<a href="{{ $settings['url'] }}">esc_url( $settings['url'] )
JavaScript stringwp_json_encode()Inline JS with user data
CSS valuesanitize_text_field() for string, validate range/unit for numericcolor(), font-size
Dynamic CSS selectorValidate against whitelistUse _id from Elementor repeater, avoid concatenation

Safe pattern in render():

protected function render(): void {
    $settings = $this->get_settings_for_display();
    ?>
    <div class="<?php echo esc_attr( $settings['css_class'] ); ?>">
        <h2><?php echo esc_html( $settings['title'] ); ?></h2>
        <a href="<?php echo esc_url( $settings['button_url'] ); ?>">
            <?php echo wp_kses_post( $settings['button_text'] ); ?>
        </a>
    </div>
    <?php
}

Guardrails

  • Do not rely on implicit defaults for critical output.
  • Do not output raw setting values without escaping.
  • Do not enqueue heavy assets globally when widget-level dependency is possible.
  • Avoid unnecessary DOM wrappers.

Extended Cases

  • If widget includes rich form behavior (validation/actions/record processing), route to $elementor-forms.
  • If control injection into third-party widgets is needed, use element hooks before/after section boundaries.

Minimal Example

class Card_Widget extends \Elementor\Widget_Base {
    public function get_name(): string { return 'card_widget'; }
    public function get_title(): string { return esc_html__( 'Card', 'vendor-kit' ); }
    public function get_categories(): array { return [ 'basic' ]; }
    public function get_script_depends(): array { return [ 'vendor-card' ]; }
    protected function register_controls(): void {}
    protected function render(): void {}
    protected function content_template(): void {}
}

What ships with it: 1 file

273 B alongside SKILL.md

agents/

Keep looking

Skills are one crate of 327,069. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.