Changeset 1089689
- Timestamp:
- 02/14/2015 06:10:46 AM (11 years ago)
- Location:
- somatic-framework
- Files:
-
- 4 edited
-
tags/1.8.11/inc/somaOptions.php (modified) (4 diffs)
-
tags/1.8.11/readme.txt (modified) (1 diff)
-
trunk/inc/somaOptions.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
somatic-framework/tags/1.8.11/inc/somaOptions.php
r1089471 r1089689 49 49 add_action('do_feed_rss2_comments', array( __CLASS__, 'disable_feeds' ) ); 50 50 add_action('do_feed_atom_comments', array( __CLASS__, 'disable_feeds' ) ); 51 add_action('template_redirect', array( __CLASS__, 'attachment_page_redirect'), 1); // nukes the "attachment page" by redirecting any views to the parent 51 add_action( 'template_redirect', array( __CLASS__, 'attachment_page_redirect'), 1); // nukes the "attachment page" by redirecting any views to the parent 52 add_action( 'add_attachment', array( __CLASS__, 'blank_file_title' ) ); // wp fills in title field with filename by default when uploading. this kills that. 52 53 53 54 // add_action( 'show_user_profile', array(__CLASS__, 'show_extra_profile_fields') ); // unused … … 90 91 "typekit" => "", // stores typekit ID and outputs necessary scripts 91 92 "google_analytics" => "", // stores google analytics ID and outputs necessary scripts 92 "kill_attachment_pages" => 1 // redirects attachment pages to parent 93 "kill_attachment_pages" => 1, // redirects attachment pages to parent 94 "blank_file_title" => 0 // stops wp from making the title the filename 93 95 ); 94 96 … … 469 471 <label><input name="somatic_framework_options[enable_page_excerpts]" type="checkbox" value="1" <?php if ( isset( $soma_options['enable_page_excerpts'] ) ) { checked( '1', $soma_options['enable_page_excerpts'] ); } ?> /> Enable excerpts for built-in Pages</label><br /> 470 472 <label><input name="somatic_framework_options[fulldisplayname]" type="checkbox" value="1" <?php if ( isset( $soma_options['fulldisplayname'] ) ) { checked( '1', $soma_options['fulldisplayname'] ); } ?> /> Force display name to be Firstname Lastname (wp default is the username)</label><br /> 471 <label><input name="somatic_framework_options[kill_attachment_pages]" type="checkbox" value="1" <?php if ( isset( $soma_options['kill_attachment_pages'] ) ) { checked( '1', $soma_options['kill_attachment_pages'] ); } ?> /> Disable solo attachment pages by redirecting to parent post</label><br /> 473 <label><input name="somatic_framework_options[kill_attachment_pages]" type="checkbox" value="1" <?php if ( isset( $soma_options['kill_attachment_pages'] ) ) { checked( '1', $soma_options['kill_attachment_pages'] ); } ?> /> Disable linking to attachment pages by redirecting to parent post</label><br /> 474 <label><input name="somatic_framework_options[blank_file_title]" type="checkbox" value="1" <?php if ( isset( $soma_options['blank_file_title'] ) ) { checked( '1', $soma_options['blank_file_title'] ); } ?> /> Leave "title" field blank when uploading files (stop automatic insertion of filename)</label><br /> 472 475 <input type="submit" class="clicker" value="Save Changes" /> 473 476 </td> … … 1167 1170 } 1168 1171 1172 function blank_file_title( $attachment_ID ) { 1173 global $soma_options; 1174 if ( somaFunctions::fetch_index( $soma_options, 'blank_file_title' ) ) { 1175 $the_post = array(); 1176 $the_post['ID'] = $attachment_ID; 1177 $the_post['post_title'] = ''; 1178 wp_update_post( $the_post ); 1179 } 1180 } 1181 1169 1182 /////////////// END CLASS 1170 1183 } -
somatic-framework/tags/1.8.11/readme.txt
r1089458 r1089689 38 38 * NEW: option to enable built-in page excerpts 39 39 * NEW: option to disable attachment pages (redirecting to parent post) 40 * NEW: option to prevent WP from automatically titling new image uploads with the filename 40 41 * more metabox disabling for themeblvd stuff 41 42 -
somatic-framework/trunk/inc/somaOptions.php
r1089471 r1089689 49 49 add_action('do_feed_rss2_comments', array( __CLASS__, 'disable_feeds' ) ); 50 50 add_action('do_feed_atom_comments', array( __CLASS__, 'disable_feeds' ) ); 51 add_action('template_redirect', array( __CLASS__, 'attachment_page_redirect'), 1); // nukes the "attachment page" by redirecting any views to the parent 51 add_action( 'template_redirect', array( __CLASS__, 'attachment_page_redirect'), 1); // nukes the "attachment page" by redirecting any views to the parent 52 add_action( 'add_attachment', array( __CLASS__, 'blank_file_title' ) ); // wp fills in title field with filename by default when uploading. this kills that. 52 53 53 54 // add_action( 'show_user_profile', array(__CLASS__, 'show_extra_profile_fields') ); // unused … … 90 91 "typekit" => "", // stores typekit ID and outputs necessary scripts 91 92 "google_analytics" => "", // stores google analytics ID and outputs necessary scripts 92 "kill_attachment_pages" => 1 // redirects attachment pages to parent 93 "kill_attachment_pages" => 1, // redirects attachment pages to parent 94 "blank_file_title" => 0 // stops wp from making the title the filename 93 95 ); 94 96 … … 469 471 <label><input name="somatic_framework_options[enable_page_excerpts]" type="checkbox" value="1" <?php if ( isset( $soma_options['enable_page_excerpts'] ) ) { checked( '1', $soma_options['enable_page_excerpts'] ); } ?> /> Enable excerpts for built-in Pages</label><br /> 470 472 <label><input name="somatic_framework_options[fulldisplayname]" type="checkbox" value="1" <?php if ( isset( $soma_options['fulldisplayname'] ) ) { checked( '1', $soma_options['fulldisplayname'] ); } ?> /> Force display name to be Firstname Lastname (wp default is the username)</label><br /> 471 <label><input name="somatic_framework_options[kill_attachment_pages]" type="checkbox" value="1" <?php if ( isset( $soma_options['kill_attachment_pages'] ) ) { checked( '1', $soma_options['kill_attachment_pages'] ); } ?> /> Disable solo attachment pages by redirecting to parent post</label><br /> 473 <label><input name="somatic_framework_options[kill_attachment_pages]" type="checkbox" value="1" <?php if ( isset( $soma_options['kill_attachment_pages'] ) ) { checked( '1', $soma_options['kill_attachment_pages'] ); } ?> /> Disable linking to attachment pages by redirecting to parent post</label><br /> 474 <label><input name="somatic_framework_options[blank_file_title]" type="checkbox" value="1" <?php if ( isset( $soma_options['blank_file_title'] ) ) { checked( '1', $soma_options['blank_file_title'] ); } ?> /> Leave "title" field blank when uploading files (stop automatic insertion of filename)</label><br /> 472 475 <input type="submit" class="clicker" value="Save Changes" /> 473 476 </td> … … 1167 1170 } 1168 1171 1172 function blank_file_title( $attachment_ID ) { 1173 global $soma_options; 1174 if ( somaFunctions::fetch_index( $soma_options, 'blank_file_title' ) ) { 1175 $the_post = array(); 1176 $the_post['ID'] = $attachment_ID; 1177 $the_post['post_title'] = ''; 1178 wp_update_post( $the_post ); 1179 } 1180 } 1181 1169 1182 /////////////// END CLASS 1170 1183 } -
somatic-framework/trunk/readme.txt
r1089458 r1089689 38 38 * NEW: option to enable built-in page excerpts 39 39 * NEW: option to disable attachment pages (redirecting to parent post) 40 * NEW: option to prevent WP from automatically titling new image uploads with the filename 40 41 * more metabox disabling for themeblvd stuff 41 42
Note: See TracChangeset
for help on using the changeset viewer.