Create a filter in PHP to force an image
-
I would like to use a filter, or some other PHP method to force my own image (based on exterior factors) to a wordpress post when sent to Facebook.
Let’s say I have defined a full path to a PHP constant
define('MY_FP_IMAGE_PATH','https://mydomain.com/images/something.jpg')
This is now the image I wish to use in the facebook post.
I will gladly pay for the pro version, if this can be solved with a filter, or some way without changing any of the plugin codes.
My single post page, for this category already includes the meta:
<meta property='og:image' content='https://mydomain.com/images/something.jpg' />
I was hoping if I set it to “Let Facebook Select” it would use this property automatically, but did not.
Any advice would be appreciated.
- The topic ‘Create a filter in PHP to force an image’ is closed to new replies.