Using web hooks json
-
I’m using a web hook to pull content from my blog into other areas of my site which isn’t wordpress. I’m using code like the below:
<?php if( $latest = @file_get_contents( 'https://www.my-domain.com/my-blog/?wp_hook=get_posts' ) ) : ?> <?php $_latest = json_decode( $latest ); ?> <ul> <?php foreach( $_latest->return as $latest ) : ?> <li><?php echo $latest->post_title; ?></li> <?php endforeach; ?> </ul> <?php endif; ?>
The url returns the data as a json encoded array. It appears to be working fine. Longer term though are there any performance issues/issues I could encounter pulling data out of my blog this way?
- The topic ‘Using web hooks json’ is closed to new replies.