fix: capture gospel when assigning carta
Co-authored-by: rafa <rcalvotorrejon@gmail.com> Signed-off-by: rafa <rcalvotorrejon@gmail.com>
This commit is contained in:
@@ -126,6 +126,14 @@ add_action('transition_post_status', function($new_status, $old_status, $post) {
|
||||
if ($new_status === 'publish' && $old_status !== 'publish') fea_evangelio_capture_meta($post->ID);
|
||||
}, 20, 3);
|
||||
|
||||
/** Completa la cita cuando llega la carta, aunque el comentario ya estuviera publicado. */
|
||||
function fea_evangelio_capture_meta_on_carta_assignment($meta_id, $post_id, $meta_key, $meta_value) {
|
||||
if ($meta_key !== '_carta_id' || !(int) $meta_value) return;
|
||||
fea_evangelio_capture_meta((int) $post_id);
|
||||
}
|
||||
add_action('added_post_meta', 'fea_evangelio_capture_meta_on_carta_assignment', 20, 4);
|
||||
add_action('updated_post_meta', 'fea_evangelio_capture_meta_on_carta_assignment', 20, 4);
|
||||
|
||||
/** Añade referencia y texto plegado, cerrado por defecto, antes del comentario. */
|
||||
add_filter('the_content', function($content) {
|
||||
if (!is_single() || is_admin()) return $content;
|
||||
|
||||
Reference in New Issue
Block a user