tag * * @since 3.3.0 */ public function insert_head_code() { $this->insert_code( 'head' ); } /** * Insert code after
tag * * @since 3.3.0 */ public function insert_body_code() { $this->insert_code( 'body' ); } /** * Insert code in footer section before tag * * @since 3.3.0 */ public function insert_footer_code() { $this->insert_code( 'footer' ); } /** * Insert code * * @since 3.3.0 */ public function insert_code( $location ) { // Do not insert code in admin, feed, robots or trackbacks if ( is_admin() || is_feed() || is_robots() || is_trackback() ) { return; } // Get option that stores the code $options = get_option( ASENHA_SLUG_U, array() ); if ( 'head' == $location ) { $code = array_key_exists( 'head_code', $options ) ? $options['head_code'] : ''; } if ( 'body' == $location ) { $code = array_key_exists( 'body_code', $options ) ? $options['body_code'] : ''; } if ( 'footer' == $location ) { $code = array_key_exists( 'footer_code', $options ) ? $options['footer_code'] : ''; } echo wp_unslash( $code ) . PHP_EOL; } }