ID)) { return $title; } return '' . $title . ''; } /** * Adds template markers to the categories * * Adds the markers, which are HTML comments, to the categories of * the post. * * @param string $cat The post categories * @return string */ function enp_cats($cat) { global $post, $user_ID; if (is_feed()) { return $cat; } if (!user_can_edit_post($user_ID, $post->ID)) { return $cat; } return '' . $cat . ''; } /** * Adds template markers to the post content * * Adds the markers, which are HTML comments, to the content * of the post, and adds the Edit n Place buttons. * * @param string $content The post content * @return string */ function enp_content($content) { global $post, $user_ID, $editnplace_linkFunctionCalled; if (is_feed()) { return $content; } if (!user_can_edit_post($user_ID, $post->ID)) { return $content; } $link = '' . $content . ''; if (!$editnplace_linkFunctionCalled) { $link .= 'Edit N Place'; } return $link; } /** * Adds JavaScript/CSS to the document head * * Adds all the needed JS and CSS to the document head. * * @return void */ function enp_wpHead() { global $userdata; get_currentuserinfo(); if (empty($userdata)) { return; } echo "\r\n"; echo "\r\n"; echo ""; echo ""; } /** * Edit N Place edit link function * * You can replace WordPress's built in edit link function with this one, and * put your edit link where ever you want to. Takes one parameter, which is the * text to show for the edit link. The default is 'Edit N Place'. * * @param string $text The text to display for the link * @return void */ function enp_edit_link($before = '', $text = 'Edit N Place', $after = '') { global $user_ID, $post, $editnplace_linkFunctionCalled; if (!user_can_edit_post($user_ID, $post->ID)) { return; } $editnplace_linkFunctionCalled = true; $link = $before . '' . $text . '' . $after; echo $link; } ?>