function save_credits() { check_admin_referer(__CLASS__); $page_options = explode(',', stripslashes($_POST['page_options'])); if ($page_options) { $options = Footer_Credits_Options::get_options(); foreach ($page_options as $option) { $val = array_key_exists($option, $_POST) ? trim(stripslashes($_POST[$option])) : ''; if (Footer_Credits_Options::is_terms_key($option)) { $options['terms'][$option] = $val; } else { switch ($option) { case 'footer_remove': $options[$option] = !empty($val); break; case 'footer_hook': case 'footer_filter_hook': $options[$option] = preg_replace('/\\W/', '', $val); break; default: $options[$option] = trim($val); } } } //end for ; $saved = Footer_Credits_Options::save_options($options); $message = $saved ? 'updated successfully' : 'have not been updated'; $is_error = false; } else { $message = 'not found!'; $is_error = true; } $this->add_admin_notice('Footer Settings ', $message, $is_error); return $saved; }
public static function footer($atts = array()) { $params = shortcode_atts(Footer_Credits_Options::get_options(), $atts); //apply plugin defaults if ($params['center']) { if (!$params['two_lines']) { $params['section_separator'] = $params['item_separator']; } $params['return_class'] .= ' return-center'; $params['footer_class'] .= ' footer-center'; $clear = ''; } else { if (!$params['two_lines']) { $params['item_separator'] = $params['section_separator']; } $params['return_class'] .= ' return-left'; $params['footer_class'] .= ' footer-right'; $clear = '<div class="clear"></div>'; } $format = '<div id="%1$s" class="%2$s">%3$s%4$s%5$s</div>%6$s'; return (empty($params['show_return']) ? '' : self::return_to_top($params['return_text'], $params['return_class'])) . sprintf($format, self::CODE, $params['footer_class'], empty($params['nav_menu']) ? '' : self::footer_menu(array('menu' => $params['nav_menu'])), empty($params['show_copyright']) ? '' : sprintf('%1$s%2$s', $params['item_separator'], self::copyright_owner(Footer_Credits_Options::get_terms())), self::contact_info($params), $clear); }