CleverWebAdmin

WP vs CW

Mar 10th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php // good ?>
  2. <div class="foo" id="bar">
  3.   <a
  4.     href="<?php
  5.      add_query_arg(
  6.        array(
  7.          'id'   => get_current_user_id(),
  8.          'hash' => wp_hash($info)
  9.        )
  10.        the_permalink()
  11.      );
  12.    ?>"
  13.     alt="Click Me!"
  14.     rel="follow"
  15.     title="<?php the_title_attribute(); ?>"
  16.     target="_blank"
  17.   ><?php the_title(); ?></a>
  18. </div>
  19.  
  20. <?php
  21. // better
  22. $_cw->blog->post_link(TRUE , // turn echo on
  23.   array( // args array
  24.     'wrap_tag'   => 'div',
  25.     'wrap_class' => 'foo',
  26.     'wrap_id'    => 'bar',
  27.     'target'     => '_blank',
  28.     'alt'        => 'Click Me!',
  29.     'rel'        => 'follow',
  30.     'text'       => $_CW->blog->post_title // visible text of link
  31.     'query'      =>
  32.       array(
  33.         'id'   => $_cw->user->id(),
  34.         'hash' => $_cw->secure->hash($info),
  35.       )
  36.   )
  37. );
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment