This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- ./mysql:/var/lib/mysql | |
ports: | |
- "3306:3306" | |
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Redirect all attachment pages to actual file | |
*/ | |
function redirect_attachment_pages() { | |
global $post; | |
// Return if not an attachment | |
if ( !is_attachment() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gets the top most ancestor for a post. | |
* | |
* @param object $post The current post | |
* | |
* @return integer The post ID of the ancestor | |
*/ | |
function get_top_ancestor( $post ) { | |
if ( $post->post_parent ) { | |
$ancestors = get_post_ancestors( $post->ID ); |
NewerOlder