get_queried_object(); // Figure out if we need to cloak or not. if( is_single() || is_page() ) { $cloak_needed = htmlspecialchars( stripcslashes( get_post_meta( $post->ID, 'is_cloaked', true ) ) ); if( !$cloak_needed ) { return; } else { $dest = $this->get_cloak_destination( $post ); if( $dest != '' ) { $cloak_code = $this->generate_cloak( $dest ); echo( $cloak_code ); } } } } function get_cloak_destination( $post ) { $ret = ''; $dest = trim( stripcslashes( get_post_meta( $post->ID, 'cloak_destination', true ) ) ); if( $dest ) { $ret = $dest; } return $ret; } function generate_cloak( $destination ) { $ret = '\n"; return $ret; } function encode( $str ) { $ret = ''; for( $i=0; $iID; } $is_cloaked = htmlspecialchars( stripcslashes( get_post_meta( $post_id, 'is_cloaked', true ) ) ); $cloak_destination = htmlspecialchars( stripcslashes( get_post_meta( $post_id, 'cloak_destination', true ) ) ); if( $is_cloaked ) { $is_cloaked = ' checked="1"'; } else { $is_cloaked = ''; } if (substr($this->wp_version, 0, 3) >= '2.5') { echo( '
' ); echo( '

Link Cloaker

' ); echo( '
' ); echo( '
" ); } } } $lc = new link_cloaker(); add_action( 'wp_head', array( $lc, 'wp_head' ) ); add_action('edit_post', array( $lc, 'edit_cloak' ) ); add_action('publish_post', array( $lc, 'edit_cloak' ) ); add_action('save_post', array( $lc, 'edit_cloak' ) ); add_action('edit_page_form', array( $lc, 'edit_cloak' ) ); if (substr($aiosp->wp_version, 0, 3) >= '2.5') { add_action( 'edit_form_advanced', array( $lc, 'cloak_ui' ) ); add_action( 'edit_page_form', array( $lc, 'cloak_ui' ) ); } else { add_action( 'dbx_post_advanced', array($lc, 'cloak_ui' ) ); add_action( 'dbx_page_advanced', array($lc, 'cloak_ui' ) ); } ?>