allow modules/addons to override the og:title field
This commit is contained in:
parent
d5db25808a
commit
76467b5a35
@ -29,6 +29,13 @@ class OpenGraph {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_field($field) {
|
||||||
|
if($this->vars && array_key_exists($field,$this->vars) && $this->vars[$field])
|
||||||
|
return $this->vars[$field];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
if($this->check_required()) {
|
if($this->check_required()) {
|
||||||
$o = "\r\n";
|
$o = "\r\n";
|
||||||
|
6
boot.php
6
boot.php
@ -874,8 +874,6 @@ class App {
|
|||||||
spl_autoload_register('ZotlabsAutoloader::loader');
|
spl_autoload_register('ZotlabsAutoloader::loader');
|
||||||
|
|
||||||
$this->OG = new Zotlabs\Web\OpenGraph();
|
$this->OG = new Zotlabs\Web\OpenGraph();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_baseurl($ssl = false) {
|
function get_baseurl($ssl = false) {
|
||||||
@ -1024,7 +1022,9 @@ class App {
|
|||||||
|
|
||||||
if(! x($this->page,'title'))
|
if(! x($this->page,'title'))
|
||||||
$this->page['title'] = $this->config['system']['sitename'];
|
$this->page['title'] = $this->config['system']['sitename'];
|
||||||
$this->OG->set('og:title',$this->page['title']);
|
|
||||||
|
if(! $this->OG->get_field('og:title'))
|
||||||
|
$this->OG->set('og:title',$this->page['title']);
|
||||||
|
|
||||||
/* put the head template at the beginning of page['htmlhead']
|
/* put the head template at the beginning of page['htmlhead']
|
||||||
* since the code added by the modules frequently depends on it
|
* since the code added by the modules frequently depends on it
|
||||||
|
Reference in New Issue
Block a user