whyisjake

ninnypants

May 18th, 2010
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.37 KB | None | 0 0
  1. So, this is the function that will add something to the first paragraph, I want to add everything below after the_content on posts that are part of the store.
  2.  
  3. Sample function
  4. <?php
  5. function add_some_stuff($content) {
  6.     $whateveryouwanttoadd = <<<PAYPAL
  7. <form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
  8.             <input type="hidden" name="cmd" value="_cart">
  9.             <input type="hidden" name="business" value="$mama_paypal">
  10.             <input type="hidden" name="item_name" value="the_title()">
  11.             <input type="hidden" name="shopping_url" value="the_permalink()">
  12.             <input type="hidden" name="item_number" value="the_ID()">
  13.             <input type="hidden" name="amount" value="$price[0]">
  14.             <input type="hidden" name="currency_code" value="USD">
  15.             <input type="hidden" name="shipping" value="$shipping[0]">
  16.             <input type="hidden" name="shipping2" value="$another[0]">
  17.             <input type="hidden" name="handling_cart" value="$mama_handling">
  18.             <input type="hidden" name="bn"  value="ButtonFactory.PayPal.001">
  19.             <input type="image" name="add" src="http://www.powersellersunite.com/buttonfactory/sc-but-01.gif">
  20.         </form>
  21. PAYPAL;
  22.  
  23.         $content = preg_replace('/<\/p>/', '</p><p>'. $whateveryouwanttoadd.'</p>', $content, 1);
  24.  
  25.     return $content;
  26. }
  27.  
  28. add_filter('the_content', 'add_some_stuff');
  29. ?>
  30. All of this is the paypal link stuff that needs to be added.
Add Comment
Please, Sign In to add comment