shpemu

wp-admin/custom-background.php Alterations

Apr 3rd, 2012
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.05 KB | None | 0 0
  1. //wp-admin/custom-background.php Alterations (starting at line 139)
  2. /* ADDED BY SHARON MURPHY 03/30/2012 */
  3. //      if ( isset($_POST['background-position-x']) ) {
  4. //          check_admin_referer('custom-background');
  5. //          if ( in_array($_POST['background-position-x'], array('center', 'right', 'left')) )
  6. //              $position = $_POST['background-position-x'];
  7. //          else
  8. //              $position = 'left';
  9. //          set_theme_mod('background_position_x', $position);
  10. //      }
  11.         if ( isset($_POST['background-position-x']) ) {
  12.             check_admin_referer('custom-background');
  13.             if ( in_array($_POST['background-position-x'], array('center', 'right', 'left')) )
  14.                 $xPosition = $_POST['background-position-x'];
  15.             else
  16.                 $xPosition = 'left';
  17.             set_theme_mod('background_position_x', $xPosition);
  18.         }
  19.  
  20.         if ( isset($_POST['background-position-y']) ) {
  21.             check_admin_referer('custom-background');
  22.             if ( in_array($_POST['background-position-y'], array('top', 'center', 'bottom')) )
  23.                 $yPosition = $_POST['background-position-y'];
  24.             else
  25.                 $yPosition = 'top';
  26.             set_theme_mod('background_position_y', $yPosition);
  27.         }
  28. /* END ADDON BY SHARON MURPHY 03/30/2012 */
  29.  
  30. //wp-admin/custom-background.php Alterations (starting at line 223)
  31. // BEGIN EDIT BY SHARON MURPHY 03/30/2012
  32. //      . ' background-position: top ' . get_theme_mod('background_position_x', 'left');
  33.         . ' background-position: ' . get_theme_mod('background_position_y', 'top') . ' ' . get_theme_mod('background_position_x', 'left');
  34. // END EDIT BY SHARON MURPHY 03/30/2012
  35.  
  36.  
  37. //wp-admin/custom-background.php Alterations (starting at line 283)
  38. <!-- BEGIN EDITS BY SHARON MURPHY 03/30/2012 -->
  39. <!--    <tr valign="top">
  40.         <th scope="row"><?php //_e( 'Position' ); ?></th>
  41.         <td><fieldset><legend class="screen-reader-text"><span><?php //_e( 'Background Position' ); ?></span></legend>
  42.             <label>
  43.                 <input name="background-position-x" type="radio" value="left"<?php //checked('left', get_theme_mod('background_position_x', 'left')); ?> />
  44.                 <?php //_e('Left') ?>
  45.             </label>
  46.             <label>
  47.                 <input name="background-position-x" type="radio" value="center"<?php //checked('center', get_theme_mod('background_position_x', 'left')); ?> />
  48.                 <?php //_e('Center') ?>
  49.             </label>
  50.             <label>
  51.                 <input name="background-position-x" type="radio" value="right"<?php //checked('right', get_theme_mod('background_position_x', 'left')); ?> />
  52.                 <?php //_e('Right') ?>
  53.             </label>
  54.         </fieldset></td>
  55.     </tr> -->
  56.     <tr valign="top">
  57.         <th scope="row"><?php _e( 'Horizontal Position' ); ?></th>
  58.         <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend>
  59.             <label>
  60.                 <input name="background-position-x" type="radio" value="left"<?php checked('left', get_theme_mod('background_position_x', 'left')); ?> />
  61.                 <?php _e('Left') ?>
  62.             </label>
  63.             <label>
  64.                 <input name="background-position-x" type="radio" value="center"<?php checked('center', get_theme_mod('background_position_x', 'left')); ?> />
  65.                 <?php _e('Center') ?>
  66.             </label>
  67.             <label>
  68.                 <input name="background-position-x" type="radio" value="right"<?php checked('right', get_theme_mod('background_position_x', 'left')); ?> />
  69.                 <?php _e('Right') ?>
  70.             </label>
  71.         </fieldset></td>
  72.     </tr>
  73.     <tr valign="top">
  74.         <th scope="row"><?php _e( 'Vertical Position' ); ?></th>
  75.         <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend>
  76.             <label>
  77.                 <input name="background-position-y" type="radio" value="top"<?php checked('top', get_theme_mod('background_position_y', 'top')); ?> />
  78.                 <?php _e('Top') ?>
  79.             </label>
  80.             <label>
  81.                 <input name="background-position-y" type="radio" value="center"<?php checked('center', get_theme_mod('background_position_y', 'top')); ?> />
  82.                 <?php _e('Center') ?>
  83.             </label>
  84.             <label>
  85.                 <input name="background-position-y" type="radio" value="bottom"<?php checked('bottom', get_theme_mod('background_position_y', 'top')); ?> />
  86.                 <?php _e('Bottom') ?>
  87.             </label>
  88.         </fieldset></td>
  89.     </tr>
  90. <!-- END EDITS BY SHARON MURPHY 03/30/2012 -->
Advertisement
Add Comment
Please, Sign In to add comment