Changeset 1089406
- Timestamp:
- 02/13/2015 09:13:12 PM (11 years ago)
- File:
-
- 1 edited
-
somatic-framework/trunk/inc/somaOptions.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
somatic-framework/trunk/inc/somaOptions.php
r1070804 r1089406 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 52 52 53 // add_action( 'show_user_profile', array(__CLASS__, 'show_extra_profile_fields') ); // unused … … 77 78 "kill_revisions" => array(), // array of post types slugs to disable autosave 78 79 "disable_menus" => array( 'links', 'tools' ), // hide admin sidebar menu items from everyone (but you could still go to the page directly) 79 "disable_dashboard" => array( 'quick_press', 'recent_drafts', 'recent_comments', 'incoming_links', 'plugins', 'primary', 'secondary', 'thesis_news_widget' ), // hide dashboard widgets from everyone80 "disable_dashboard" => array( 'quick_press', 'recent_drafts', 'recent_comments', 'incoming_links', 'plugins', 'primary', 'secondary', 'thesis_news_widget', 'tribe_dashboard_widget' ), // hide dashboard widgets from everyone 80 81 "disable_metaboxes" => array( 'thesis_seo_meta', 'thesis_image_meta', 'thesis_multimedia_meta', 'thesis_javascript_meta', 'tb_page_options' ), // hide metaboxes in post editor from everyone 81 82 "disable_drag_metabox" => 0, // prevent users from dragging/rearranging metaboxes (even dashboard widgets) … … 89 90 "typekit" => "", // stores typekit ID and outputs necessary scripts 90 91 "google_analytics" => "", // stores google analytics ID and outputs necessary scripts 92 "kill_attachment_pages" => 1 // redirects attachment pages to parent 91 93 ); 92 94 … … 467 469 <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 /> 468 470 <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 /> 469 472 <input type="submit" class="clicker" value="Save Changes" /> 470 473 </td> … … 533 536 </th> 534 537 <td> 535 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="quick_press" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'quick_press', $soma_options['disable_dashboard'] ) ); } ?> /> Quick Press </label><br /> 536 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="recent_drafts" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'recent_drafts', $soma_options['disable_dashboard'] ) ); } ?> /> Recent Drafts </label><br /> 537 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="recent_comments" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'recent_comments', $soma_options['disable_dashboard'] ) ); } ?> /> Recent Comments </label><br /> 538 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="incoming_links" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'incoming_links', $soma_options['disable_dashboard'] ) ); } ?> /> Incoming Links </label><br /> 539 </td> 540 <td> 541 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="plugins" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'plugins', $soma_options['disable_dashboard'] ) ); } ?> /> Plugins </label><br /> 542 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="primary" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'primary', $soma_options['disable_dashboard'] ) ); } ?> /> Wordpress Blog </label><br /> 543 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="secondary" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'secondary', $soma_options['disable_dashboard'] ) ); } ?> /> Other Wordpress News </label><br /> 544 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="thesis_news_widget" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'thesis_news_widget', $soma_options['disable_dashboard'] ) ); } ?> /> Thesis News </label><br /> 545 </td> 538 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="quick_press" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'quick_press', $soma_options['disable_dashboard'] ) ); } ?> /> Quick Press</label><br /> 539 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="recent_drafts" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'recent_drafts', $soma_options['disable_dashboard'] ) ); } ?> /> Recent Drafts</label><br /> 540 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="recent_comments" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'recent_comments', $soma_options['disable_dashboard'] ) ); } ?> /> Recent Comments</label><br /> 541 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="incoming_links" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'incoming_links', $soma_options['disable_dashboard'] ) ); } ?> /> Incoming Links</label><br /> 542 </td> 543 <td> 544 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="plugins" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'plugins', $soma_options['disable_dashboard'] ) ); } ?> /> Plugins</label><br /> 545 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="primary" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'primary', $soma_options['disable_dashboard'] ) ); } ?> /> Wordpress Blog</label><br /> 546 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="secondary" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'secondary', $soma_options['disable_dashboard'] ) ); } ?> /> Other Wordpress News</label><br /> 547 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="thesis_news_widget" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'thesis_news_widget', $soma_options['disable_dashboard'] ) ); } ?> /> Thesis News</label><br /> 548 </td> 549 <td> 550 <label><input name="somatic_framework_options[disable_dashboard][]" type="checkbox" value="tribe_dashboard_widget" <?php if ( is_array( $soma_options['disable_dashboard'] ) ) { checked( '1', in_array( 'tribe_dashboard_widget', $soma_options['disable_dashboard'] ) ); } ?> /> Modern Tribe News</label><br /> 551 </td> 552 553 546 554 </tr> 547 555 … … 559 567 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="revisionsdiv" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'revisionsdiv', $soma_options['disable_metaboxes'] ) ); } ?> /> Revisions</label><br /> 560 568 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="authordiv" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'authordiv', $soma_options['disable_metaboxes'] ) ); } ?> /> Author</label><br /> 561 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="tb_page_options" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'tb_page_options', $soma_options['disable_metaboxes'] ) ); } ?> /> Jump Start Page Options</label><br />562 569 </td> 563 570 <td> … … 571 578 </td> 572 579 <td> 580 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="tb_page_options" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'tb_page_options', $soma_options['disable_metaboxes'] ) ); } ?> /> Jump Start Page Options</label><br /> 581 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="tb_post_options" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'tb_post_options', $soma_options['disable_metaboxes'] ) ); } ?> /> ThemeBlvd Post Options</label><br /> 582 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="tb_banner_options" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'tb_banner_options', $soma_options['disable_metaboxes'] ) ); } ?> /> ThemeBlvd Banner</label><br /> 583 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="tb_sidebars" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'tb_sidebars', $soma_options['disable_metaboxes'] ) ); } ?> /> ThemeBlvd Sidebar Overrides</label><br /> 584 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="tb_layout_options" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'tb_layout_options', $soma_options['disable_metaboxes'] ) ); } ?> /> ThemeBlvd Theme Layout</label><br /> 585 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="pto" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'pto', $soma_options['disable_metaboxes'] ) ); } ?> /> ThemeBlvd Post Template Options</label><br /> 586 </td> 587 <td> 573 588 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_seo_meta" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_seo_meta', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis SEO</label><br /> 574 589 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_image_meta" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_image_meta', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis Image</label><br /> 575 590 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_multimedia_meta" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_multimedia_meta', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis Multimedia</label><br /> 576 591 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_javascript_meta" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_javascript_meta', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis Javascript</label><br /> 577 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_title_tag" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_title_tag', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis 2.0 Custom Title</label><br /> 578 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_meta_description" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_meta_description', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis 2.0 Meta Description</label><br /> 579 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_meta_keywords" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_meta_keywords', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis 2.0 Meta Keywords</label><br /> 580 </td> 581 <td> 592 </td> 593 <!-- <td> 582 594 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_meta_robots" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_meta_robots', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis 2.0 Meta Robots</label><br /> 583 595 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_canonical_link" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_canonical_link', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis 2.0 Canonical URL</label><br /> … … 587 599 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_post_thumbnail" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_post_thumbnail', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis 2.0 Post Thumbnail</label><br /> 588 600 <label><input name="somatic_framework_options[disable_metaboxes][]" type="checkbox" value="thesis_redirect" <?php if ( is_array( $soma_options['disable_metaboxes'] ) ) { checked( '1', in_array( 'thesis_redirect', $soma_options['disable_metaboxes'] ) ); } ?> /> Thesis 2.0 301 Redirect</label><br /> 589 </td> 601 </td> --> 590 602 </tr> 591 603 … … 831 843 if ( in_array( "secondary", $soma_options['disable_dashboard'] ) ) remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' ); 832 844 if ( in_array( "thesis_news_widget", $soma_options['disable_dashboard'] ) ) remove_meta_box( 'thesis_news_widget', 'dashboard', 'normal' ); 845 if ( in_array( "tribe_dashboard_widget", $soma_options['disable_dashboard'] ) ) remove_meta_box( 'tribe_dashboard_widget', 'dashboard', 'normal' ); 833 846 } 834 847 … … 1139 1152 } 1140 1153 1154 function attachment_page_redirect() { 1155 global $soma_options, $post; 1156 if ( somaFunctions::fetch_index( $soma_options, 'kill_attachment_pages' ) ) { 1157 if ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent != 0) ) { 1158 // permanent redirect to post/page where image or document was uploaded 1159 wp_redirect( get_permalink( $post->post_parent ), 301 ); 1160 exit; 1161 } elseif ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent < 1) ) { // for some reason it doesnt works checking for 0, so checking lower than 1 instead... 1162 // temp redirect to home for image or document not associated to any post/page 1163 wp_redirect( get_bloginfo( 'url' ), 302 ); 1164 exit; 1165 } 1166 } 1167 } 1168 1141 1169 /////////////// END CLASS 1142 1170 }
Note: See TracChangeset
for help on using the changeset viewer.