Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom-fields not syndicating on publish, requires update #41

Open
voidzone opened this issue Nov 28, 2017 · 0 comments
Open

custom-fields not syndicating on publish, requires update #41

voidzone opened this issue Nov 28, 2017 · 0 comments

Comments

@voidzone
Copy link

voidzone commented Nov 28, 2017

When initially publishing a post, custom fields, such as the ones used by Yoast SEO, are not syndicated out. However, if you then update the post they get sent.

Quick and dirty code used for testing:

function output_syndication($remotePost, $postId) {
	
	ob_start();
	print_r($remotePost);
	$send = ob_get_clean();
	wp_mail('email@example.com', 'syndicate test', $send);
	return $remotePost;
}
add_filter('syndicate_post_content', 'output_syndication', 10, 2);

Publish output

Array
(
    [post_type] => post
    [post_date_gmt] => IXR_Date Object
        (
            [year] => 2017
            [month] => 11
            [day] => 28
            [hour] => 12
            [minute] => 53
            [second] => 27
            [timezone] => 
        )

    [post_content] => words
    [post_title] => syn test new
    [post_excerpt] => 
    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [post_password] => 
    [custom_fields] => Array
        (
            [0] => Array
                (
                    [key] => _encloseme
                    [value] => 1
                )

            [1] => Array
                (
                    [key] => _pingme
                    [value] => 1
                )

        )

    [terms_names] => Array
        (
        )

)

Update output:

Array
(
    [post_type] => post
    [post_date_gmt] => IXR_Date Object
        (
            [year] => 2017
            [month] => 11
            [day] => 28
            [hour] => 12
            [minute] => 54
            [second] => 06
            [timezone] => 
        )

    [post_content] => words 2
    [post_title] => syn test new
    [post_excerpt] => 
    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [post_password] => 
    [custom_fields] => Array
        (
            [0] => Array
                (
                    [key] => _encloseme
                    [value] => 1
                )

            [1] => Array
                (
                    [key] => _genesis_scripts_body_position
                    [value] => bottom
                )

            [2] => Array
                (
                    [key] => _pingme
                    [value] => 1
                )

            [3] => Array
                (
                    [key] => _yoast_wpseo_canonical
                    [value] => https://example.com/syn-test/
                )

            [4] => Array
                (
                    [key] => _yoast_wpseo_content_score
                    [value] => 30
                )

            [5] => Array
                (
                    [key] => _yoast_wpseo_primary_category
                    [value] => 
                )

        )

    [terms_names] => Array
        (
        )

)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant