Code Monkey home page Code Monkey logo

elementor-custom-element's People

Contributors

dtbaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elementor-custom-element's Issues

Elementor-custom-element not functioning in Elementor 1.9.3 + Icons not displaying

Hi David, thank you for taking the time to put together this highly useful plugin, as part of the guide on your website.

On trying to follow along and implement it into my testing site, I discovered that I was unable to get the plugin to work as per your instruction on your blog. I believe there are a couple of issues surrounding this. Please note that I will be submitting a pull request alongside this issue which will address the below items. ๐Ÿ‘

1. my-widget.php File Location

On your blog, you state that you can place the my-widget.php file, within the plugin folder, and that this function as intended. However, with the Github repo, you have the code (lines 40-47, see below) to find the my-widget.php file, however it is not called by the Elementor\Widget_My_Custom_Elementor_Thing() class instance. This means that even if the file is within the addon plugin folder, it will not be called into the registration of the widget.

$widget_file = 'plugins/elementor/my-widget.php';
$template_file = locate_template($widget_file);

if ( !$template_file || !is_readable( $template_file ) ) {
	$template_file = plugin_dir_path(__FILE__).'my-widget.php';
}
if ( $template_file && is_readable( $template_file ) ) {
	require_once $template_file;
}

2. get-settings() method update

Since your post, Elementor has updated the method of fetching the values of the controls from the _register_controls() function. In the current code, this is done by calling values from the instance array.

$custom_text = ! empty( $instance['some_text'] ) ? $instance['some_text'] : ' (no text was entered ) ';
$post_count = ! empty( $instance['posts_per_page'] ) ?

With the new versions of Elementor, this array will no longer produce the values, even though they can be set in the editor. This is due to a new method within the render function: $settings = $this->get_settings();.

3. Icons not showing in the Elementor sidebar

Since your blog post, Elementor have added support for Font Awesome icons to be used in the Elementor editor sidebar. This allows for a much higher range of choice than the standard WordPress iconset. However, I believe that they have deprieciated the standard iconset used by yourself, meaning that after correcting the above issues, there is not an icon associated with the custom widget in the dashboard.

The above issues were the things I ran into while trying to create my own Elementor widget via your blog post, which took me more time than I would like to admit to figure out. Keep an eye out for the upcoming pull request with the fixes for all of these.

Thanks, have a great day!

Ben

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.