/** * Get WYSIWYG profile object. * * @param string $format_name * Text format machine name, for example: "full_html". * * @return object * WYSIWYG profile object. */ public function getProfile($format_name) { wysiwyg_profile_cache_clear(); if ($profile = wysiwyg_profile_load($format_name)) { return $profile; } }
/** * Remove a button from a WYSIWYG profile. * * @param string $profile * Profile machine name. Ex. 'full_html', etc. * @param string $group * Button group name. Ex. 'default', 'drupal', etc. * @param mixed $buttons * Array of button names belonging to the $group button group. * Ex. 'Anchor', 'BGColor', etc. */ public function removeButtonsFromProfile($profile, $group, $buttons) { if ($profile = wysiwyg_profile_load('full_html')) { foreach ($buttons as $button) { unset($profile->settings['buttons'][$group][$button]); } $this->updateProfile($profile); } }