Last active
September 4, 2019 14:44
-
-
Save eto4detak/a0847018b8898b1a5370061636a89759 to your computer and use it in GitHub Desktop.
wp php action2412
This file contains hidden or 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 | |
add_action( 'wp_head',[&$this, 'hook_css'] ); | |
function hook_css(){ | |
echo '<style>'.self::get_setting('map_styles').'</style>'; | |
} | |
add_action( 'save_post_product', 'divie_save_post_product_for_urls' ); | |
function divie_save_post_product_for_urls( $post_id ) { | |
if ( wp_is_post_revision( $post_id ) || get_post($post_id)->post_status != 'publish' ) | |
return; | |
$link = get_permalink( $post_id ); | |
if(!empty($link)){ | |
update_post_meta($post_id, 'meta_url_product', $link); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment