SOLVED: Custom Elements: 'deletable' & 'clonable' get_nestable_children() method not working

I messed around with the get_nestable_children method for custom-elements and noticed that the ‘deletable’ & ‘clonable’ settings both don’t do anything anymore. Also tested it with the nav-menu & offcanvas and also not working.

Is this on purpose or was it depracted?


	/**
	 * MARK: Get Nestable Children
	 */
	public function get_nestable_children()
	{
		$selector = $this->name;

		$elements = [];

		foreach (Misc::$avaibleLanguages as $code => $lang) {
			$name = $lang['name'];

			$elements[] = [
				'name'     => 'block',
				'label'    => esc_html__('Content', 'bricks') . " [$name]",
				'deletable' => false, // Prevent deleting this element directly. NOTE: Undocumented (@since 1.8)
				'cloneable' => false, // Prevent cloning this element directly.  NOTE: Undocumented (@since 1.8)
				'settings' => [
					'tag'     => 'div',
					'_hidden' => [
						'_cssClasses' => "{$selector}__content",
					],
				],
			];
		}

		return $elements;
	}

Best Regards
Suat

Hi @UserfreundSuat,

Thank you so much for the report. I can replicate the issue. deletable and clonable should be working as intended, so this is a bug.

I’ve created a new internal task and it will be fixed.

Thank you,
Matej

1 Like

We’ve fixed this issue in Bricks 2.0.2 now available as a one-click update in your WordPress Dashboard.

Please take your time to read the changelog entry before updating: Bricks 2.0.2 Changelog – Bricks, and let us know if you continue to experience issues.

1 Like