PluginProbe
Elementor Website Builder – more than just a page builder / 3.2.1
Elementor Website Builder – more than just a page builder v3.2.1
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | modules/shapes/module.php +18 -39 4.2.0-dev23.2.1 View file →
@@ -2,39 +2,14 @@
2 2
3 3 namespace Elementor\Modules\Shapes;
4 4
5 5 if ( ! defined( 'ABSPATH' ) ) {
6 - exit; // Exit if accessed directly.
6 + exit; // Exit if accessed directly
7 7 }
8 8
9 9 class Module extends \Elementor\Core\Base\Module {
10 10
11 - public function __construct() {
12 - parent::__construct();
13 -
14 - add_action( 'elementor/frontend/after_register_styles', [ $this, 'register_styles' ] );
15 - }
16 -
17 11 /**
18 - * Register styles.
19 - *
20 - * At build time, Elementor compiles `/modules/shapes/assets/scss/frontend.scss`
21 - * to `/assets/css/widget-shapes.min.css`.
22 - *
23 - * @return void
24 - */
25 - public function register_styles() {
26 - wp_register_style(
27 - 'widget-text-path',
28 - $this->get_css_assets_url( 'widget-text-path', null, true, true ),
29 - [ 'elementor-frontend' ],
30 - ELEMENTOR_VERSION
31 - );
32 - }
33 -
34 - /**
35 - * Return a translated user-friendly list of the available SVG shapes.
36 - *
37 12 * @param bool $add_custom Determine if the output should include the `Custom` option.
38 13 *
39 14 * @return array List of paths.
40 15 */
@@ -39,18 +14,18 @@
39 14 * @return array List of paths.
40 15 */
41 16 public static function get_paths( $add_custom = true ) {
42 17 $paths = [
43 - 'wave' => esc_html__( 'Wave', 'elementor' ),
44 - 'arc' => esc_html__( 'Arc', 'elementor' ),
45 - 'circle' => esc_html__( 'Circle', 'elementor' ),
46 - 'line' => esc_html__( 'Line', 'elementor' ),
47 - 'oval' => esc_html__( 'Oval', 'elementor' ),
48 - 'spiral' => esc_html__( 'Spiral', 'elementor' ),
18 + 'wave' => __( 'Wave', 'elementor' ),
19 + 'arc' => __( 'Arc', 'elementor' ),
20 + 'circle' => __( 'Circle', 'elementor' ),
21 + 'line' => __( 'Line', 'elementor' ),
22 + 'oval' => __( 'Oval', 'elementor' ),
23 + 'spiral' => __( 'Spiral', 'elementor' ),
49 24 ];
50 25
51 26 if ( $add_custom ) {
52 - $paths['custom'] = esc_html__( 'Custom', 'elementor' );
27 + $paths['custom'] = __( 'Custom', 'elementor' );
53 28 }
54 29
55 30 return $paths;
56 31 }
@@ -55,16 +30,20 @@
55 30 return $paths;
56 31 }
57 32
58 33 /**
59 - * Get an SVG Path URL from the pre-defined ones.
34 + * @param $path string Path name.
60 35 *
61 - * @param string $path - Path name.
62 - *
63 - * @return string
36 + * @return string The path SVG markup.
64 37 */
65 - public static function get_path_url( $path ) {
66 - return ELEMENTOR_ASSETS_URL . 'svg-paths/' . $path . '.svg';
38 + public static function get_path_svg( $path ) {
39 + $file_name = ELEMENTOR_ASSETS_PATH . 'svg-paths/' . $path . '.svg';
40 +
41 + if ( ! is_file( $file_name ) ) {
42 + return '';
43 + }
44 +
45 + return file_get_contents( $file_name );
67 46 }
68 47
69 48 /**
70 49 * Get the module's associated widgets.