query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
return boolean as string 'true' / 'false'
function bool2str($bool) { if($bool ===false) return 'false'; else return 'true'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bool_s($boolean) {\n\treturn ($boolean ? 'true' : 'false');\n}", "public static function strbool($bool){\r\n return ($bool) ? \"true\" : \"false\";\r\n }", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "function bool_to_string($value) {\n return $value ? 'true' : 'false';\n }", "private function boolean(bool $value): string\n {\n return $value ? 'true' : 'false';\n }", "public function getBooleanString($tf);", "function b2s($b) {\n return ($b) ? 'TRUE' : 'FALSE';\n}", "function stage_bool_to_string($bool)\n{\n if (! is_bool($bool)) {\n $bool = wc_string_to_bool($bool);\n }\n return true === $bool ? 'yes' : 'no';\n}", "public function boolToStr($boolean)\n {\n return ($boolean === true) ? 'true' : 'false';\n }", "public function toBoolean()\n {\n $key = $this->toLowerCase()->str;\n $map = array(\n 'true' => true,\n '1' => true,\n 'on' => true,\n 'yes' => true,\n 'false' => false,\n '0' => false,\n 'off' => false,\n 'no' => false,\n );\n\n if (array_key_exists($key, $map)) {\n return $map[$key];\n } elseif (is_numeric($this->str)) {\n return ((int) $this->str > 0);\n } else {\n return (bool) $this->regexReplace('[[:space:]]', '')->str;\n }\n }", "protected function bool2str($bool) {\n return ($bool) ? 'TRUE' : 'FALSE';\n }", "private function boolToString ($value)\n\t{\n\t\tif (true === $value)\n\t\t{\n\t\t\treturn 'true';\n\t\t}\n\t\telseif (false === $value)\n\t\t{\n\t\t\treturn 'false';\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $value;\n\t\t}\n\t}", "function toBoolean(){\n\t\tif(in_array($this->lower(),array('','false','off','no','n','f'))){\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$this->toString();\n\t}", "public static function booleanToString($obj)\n {\n return $obj ? 'true' : 'false';\n }", "private static function bool2str($v)\n {\n //convert boolean to text value.\n $v = $v === true ? 'true' : $v;\n $v = $v === false ? 'false' : $v;\n return $v;\n }", "function bool_str($value) {\r\n if ($value) {\r\n return 'yes'; \r\n } else {\r\n return 'no';\r\n }\r\n}", "function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }", "public static function boolToString($value)\n {\n $value = $value === true ? 'true' : $value;\n $value = $value === false ? 'false' : $value;\n return $value;\n }", "public function booleanString($var)\n {\n return is_bool($var)\n ? ($var ? 'True' : 'False')\n : $var;\n }", "public static function bool2str(bool $boolean = true): string\n {\n if ($boolean === false) {\n return 'FALSE';\n } else {\n return 'TRUE';\n }\n }", "public static function boolean()\n {\n return self::builtinType('bool');\n }", "private function dbFeedBack($bool){\n if($bool == FALSE){\n //display '0' as false\n return \"{0}\"; \n }\n else{\n //display 1 as true\n return \"{1}\";\n } \n }", "public function testToStringWithBooleanValueTrue()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean(true);\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}", "public function getBooleanFormatForQueryString(): string\n {\n return $this->booleanFormatForQueryString;\n }", "function message($boolValue) {\n\tif($boolValue) {\n\t\techo \"TRUE: \";\n\t} else {\n\t\techo \"FALSE: \";\n\t}\n\techo \"GOT value as \", (int)$boolValue, \"\\n\";\n}", "public static function boolean() {}", "abstract public function escapeBoolean($bool);", "function get_bool_or_null($value)\r\n{\r\n $temp = null ;\r\n\r\n if(is_null($value)){\r\n\r\n $temp .= \"<code style='font_size: 9px ; color:#3465a4 '>\" . PHP_EOL ;\r\n \r\n $temp .= 'null' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\"; \r\n\r\n }else if(is_bool($value)){\r\n $temp .= '<code style=\"font_size: 10px\">boolean </code>';\r\n \r\n $temp .= \"<code style='font_size: 9px ; color:#75507b '>\" . PHP_EOL ;\r\n \r\n $temp .= $value == true ? 'true' : 'false' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\";\r\n \r\n }\r\n\r\n return $temp ;\r\n}", "public function testToStringWithBooleanValueFalse()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean(false);\n\t\t// check that the two boolean are equal\n\t\t$this->assertEquals('false', $boolean->__toString());\n\t}", "public static function plainBoolean($value)\n {\n if ($value === true) {\n return 'Yes';\n } elseif ($value === false) {\n return 'No';\n }\n\n return '---';\n }" ]
[ "0.80348504", "0.80206877", "0.78751075", "0.7846424", "0.76890635", "0.7611359", "0.7559533", "0.7543506", "0.7523593", "0.75164706", "0.74617386", "0.7412224", "0.7410573", "0.7393141", "0.73901856", "0.7379897", "0.73708546", "0.7250726", "0.7164452", "0.71530366", "0.7104408", "0.7081321", "0.7046958", "0.7023631", "0.6972632", "0.69654894", "0.6918694", "0.68982095", "0.68366355", "0.68304795" ]
0.8142804
0
compare two objects. Arguments are passed byreference test: equals, not equal, equal identity, not equal identity
function compareObjects(&$ob1, &$ob2) { print_pre('o1 == o2 : ' . bool2str($ob1 == $ob2)); print_pre('o1 != o2 : ' . bool2str($ob1 != $ob2)); print_pre('o1 === o2 : ' . bool2str($ob1 === $ob2)); print_pre('o1 !== o2 : ' . bool2str($ob1 !== $ob2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equals($other);", "public function equals( $A, $B );", "public function equals($other) { return $this->obj==Sandbox::unwrap($other); }", "protected function compareObjects(object $a, object $b): int\n {\n // see https://github.com/php/php-src/issues/10513\n return strcmp(spl_object_hash($a), spl_object_hash($b));\n }", "public function equals($obj): bool;", "public function testEquality()\n {\n $m1 = new BigMoney(Decimal::fromInteger(100), new Currency('EUR'));\n $m2 = new BigMoney(Decimal::fromInteger(100), new Currency('EUR'));\n $m3 = new BigMoney(Decimal::fromInteger(100), new Currency('USD'));\n $m4 = new BigMoney(Decimal::fromInteger(50), new Currency('EUR'));\n\n $this->assertTrue($m1->equals($m2));\n $this->assertFalse($m1->equals($m3));\n $this->assertFalse($m1->equals($m4));\n }", "function o_eq($a, $b) {\n\t\t\treturn Obj::singleton()->equal($a, $b);\n\t\t}", "public static function compare($a,$b);", "public function testCmpart()\n {\n $oA = new stdClass();\n $oA->cnt = 10;\n\n $oB = new stdClass();\n $oB->cnt = 10;\n\n $this->assertTrue(cmpart($oA, $oB) == 0);\n\n $oA->cnt = 10;\n $oB->cnt = 20;\n\n $this->assertTrue(cmpart($oA, $oB) == -1);\n }", "abstract protected function compare($idA, $idB);", "public function equals()\n {\n $this->assertTrue($this->stubRefProperty->equals($this->stubRefProperty));\n $stubRefProperty1 = new stubReflectionProperty('stubTestProperty1', 'property');\n $stubRefProperty2 = new stubReflectionProperty('stubTestProperty1', 'anotherProperty');\n $this->assertTrue($this->stubRefProperty->equals($stubRefProperty1));\n $this->assertTrue($stubRefProperty1->equals($this->stubRefProperty));\n $this->assertFalse($this->stubRefProperty->equals($stubRefProperty2));\n $this->assertFalse($this->stubRefProperty->equals('foo'));\n $this->assertFalse($stubRefProperty2->equals($this->stubRefProperty));\n }", "public function equals(Object $obj = null);", "protected abstract function _equals( N $other );", "function equals($x, $y);", "public function compare();", "public function equals(Object $object);", "function isEqual ( &$anObject ) {\n \t\treturn $this->isEqualTo($anObject);\n \t}", "public function scompare($o = null) {}", "function equals($a, $b){\n\tif (method_exists($a, 'equals'))\n\t\treturn $a->equals($b);\n\telse\n\t\treturn $a===$b;\n}", "abstract protected function _compare($val1, $val2);", "public function Equals___T($other);", "function test_equals($a, $b) {\n\treturn $a == $b;\n}", "public function isEqualProvider()\n {\n // Declare attributes\n $objA = new stdClass();\n $objA->foo = 'bar';\n \n $objB = new stdClass();\n \n $objC = new stdClass;\n $objC->foo = 'bar';\n $objC->int = 1;\n $objC->array = array(0, array(1), array(2), 3);\n $objC->related = new stdClass;\n $objC->self = $objC;\n $objC->c = $objC;\n \n $objD = new stdClass;\n $objD->foo = 'bar';\n $objD->int = 2;\n $objD->array = array(0, array(4), array(2), 3);\n $objD->related = new stdClass;\n $objD->self = $objD;\n $objD->c = $objC;\n \n return array(\n // Integers\n array(1, 0, <<<EOF\nFailed asserting that 0 matches expected 1.\nEOF\n ),\n \n // Integer and Double\n array(1.1, 0, <<<EOF\nFailed asserting that 0 matches expected 1.1.\nEOF\n ),\n \n // Chars\n array('a', 'b', <<<EOF\nFailed asserting that two strings are equal.\n\n- Expected \n+ Actual \n\n-'a'\n+'b'\nEOF\n ), \n \n // Integer and Array\n array(1, array(0), <<<EOF\nArray (...) does not match expected type \"integer\".\nEOF\n ),\n \n // Array and Integer\n array(array(0), 1, <<<EOF\n1 does not match expected type \"array\".\nEOF\n ),\n \n // Array and Array\n array(array(0), array(1), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n- 0 => 0\n+ 0 => 1\n )\nEOF\n ),\n \n // Boolean and boolean as string\n array(array(TRUE), array('true'), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n- 0 => true\n+ 0 => 'true'\n )\nEOF\n ),\n \n // Nested arrays\n array(array(0, array(1), array(2), 3), array(0, array(4), array(2), 3), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\nEOF\n ),\n \n \n // Object and Array\n array($objA, array(23), <<<EOF\nArray (...) does not match expected type \"object\".\nEOF\n ), \n\n // Array and Object\n array(array(23), $objA, <<<EOF\nstdClass Object (...) does not match expected type \"array\".\nEOF\n ), \n \n // Object and Object\n array($objA, $objB, <<<EOF\nFailed asserting that two objects are equal.\n\n- Expected \n+ Actual \n\n stdClass Object (\n- 'foo' => 'bar'\n )\nEOF\n ),\n \n // Complex objects\n array($objC, $objD, <<<EOF\nFailed asserting that two objects are equal.\n\n- Expected \n+ Actual \n\n stdClass Object (\n 'foo' => 'bar'\n- 'int' => 1\n+ 'int' => 2\n 'array' => Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (\n 'foo' => 'bar'\n- 'int' => 1\n+ 'int' => 2\n 'array' => Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (*RECURSION*)\n- 'c' => stdClass Object (*RECURSION*)\n+ 'c' => stdClass Object (\n+ 'foo' => 'bar'\n+ 'int' => 1\n+ 'array' => Array (\n+ 0 => 0\n+ 1 => Array (\n+ 0 => 1\n+ )\n+ 2 => Array (\n+ 0 => 2\n+ )\n+ 3 => 3\n+ )\n+ 'related' => stdClass Object ()\n+ 'self' => stdClass Object (*RECURSION*)\n+ 'c' => stdClass Object (*RECURSION*)\n+ )\n )\n 'c' => stdClass Object (\n 'foo' => 'bar'\n 'int' => 1\n 'array' => Array (\n 0 => 0\n 1 => Array (\n 0 => 1\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (*RECURSION*)\n 'c' => stdClass Object (*RECURSION*)\n )\n )\nEOF\n \n ),\n );\n }", "function cmp_obj($a, $b)\r\n {\r\n $al = $a->Top;\r\n $bl = $b->Top;\r\n if ($al == $bl) {\r\n return 0;\r\n }\r\n return ($al > $bl) ? +1 : -1;\r\n }", "function comparator($object1, $object2) {\n\t\t\treturn $object1->amount < $object2->amount; \n\t\t}", "public function testInvokeReturnsTrueIfIntegersAreEqual()\n\t{\n $this->assertTrue((new AlmostEquals())(1, 1));\n \n return;\n\t}", "function isEqualTo ( &$anObject ) {\n \t\treturn ($this === $anObject);\n \t}", "public function compareTo($other);", "public function equals($arg);", "public function shouldEqual($expected) {}" ]
[ "0.6673335", "0.65883684", "0.6582047", "0.6493526", "0.6361353", "0.6307741", "0.62992543", "0.6271147", "0.6259657", "0.62595", "0.62512934", "0.6212965", "0.62024915", "0.614383", "0.61387986", "0.60835725", "0.6081624", "0.60350287", "0.6030523", "0.60098636", "0.6003072", "0.5957396", "0.59422326", "0.5878123", "0.5871505", "0.58714783", "0.58631766", "0.58579063", "0.5837966", "0.58190906" ]
0.7712369
0
Check initial states exists
public function hasInitial() { return !empty($this->initialStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isInitial();", "public function isInitialised();", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(4);\n }", "abstract protected function checkInitialization();", "public function hasState() {\n return $this->_has(4);\n }", "public static function resetInit() {\r\n $result = true;\r\n $shops = Shop::getShops(false, null, true);\r\n foreach ($shops as $id_shop) {\r\n $result &= Configuration::updateValue(GEAR_NAME.'_init', false, false, null, $id_shop);\r\n }\r\n return $result;\r\n }", "public function is_initialized()\n {\n }", "function _loadState()\n\t{\n\n\t\tif (empty($this->_state))\n\t\t{\n\n\t\t\t// current state info\n\t\t\t$query = 'SELECT c.*, ' .\n\t\t\t\t' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\\':\\', c.id, c.alias) ELSE c.id END as slug '.\n\t\t\t\t' FROM #__ezrealty_state AS c' .\n\t\t\t\t' WHERE c.id = '. (int) $this->_id ;\n\t\t\t$this->_db->setQuery($query, 0, 1);\n\t\t\t$this->_state = $this->_db->loadObject();\n\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.6860986", "0.6655938", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.6500065", "0.64040065", "0.6381777", "0.6243098", "0.61433", "0.6128225" ]
0.76447755
0
Check final states exists
public function hasFinal() { return !empty($this->finalStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasState(){\n return $this->_has(4);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasFinishState(){\n return $this->_has(5);\n }", "public function hasState() {\n return $this->_has(4);\n }", "public function isFinalState(): bool {\n return $this->finalState;\n }", "public function isNewStates()\n {\n if ($this->isNonexistent) return false;\n\n return !!$this->countNewStates();\n }", "public function hasInitial()\n {\n return !empty($this->initialStates);\n }", "function check_state_conflict($expected)\n{\n global $STATE_FILE;\n\n // get current state\n $cur_state = trim( file_get_contents($STATE_FILE) );\n\n if($cur_state === $expected)\n {\n return false;\n }\n else\n {\n return true;\n }\n}", "public function hasTargetState($state);" ]
[ "0.6827876", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.67381245", "0.6729427", "0.6569009", "0.63520217", "0.62565976", "0.5986576", "0.5875941" ]
0.7345255
0
Get all final states
public function getFinal() { return $this->hasFinal() ? array_values($this->finalStates) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStates() {\n return $this->state;\n }", "abstract public function states();", "public function getStates(): array\n {\n return $this->states;\n }", "public function getStates(): StateSet;", "public function getStates() {\n\t\treturn empty( $this->container['states'] ) ? null : $this->container['states'];\n\t}", "protected function state_all() {\n return $this->_views->all_json();\n }", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getStates() {\n return $this->createQuery()\n ->select(\"DISTINCT c.state\")\n ->from(\"Companies_Model_Company c\")\n ->whereIn(\"c.status\", Companies_Model_Company::getActiveStatuses())\n ->andWhere(\"c.local_business\")\n ->orderBy(\"c.state ASC\")\n ->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n }", "public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FULL_NAME])\n ->distinct()\n ->where('region', '!=', \" \")\n ->orderBy(self::C_STATE)\n ->get();\n\n foreach ($values as $value) {\n $states[$value->state] = $value->stateFullName;\n }\n\n return $states;\n }", "public function fetchAll()\n\t{\n\t\t$states = $this->getStatesModel()->fetchAll();\n\t\treturn $states;\n\t}", "public function getNextStates()\n {\n return $this->nextStates;\n }", "public function getStateList() {\n $states = State::latest()->paginate(10);\n return $states;\n }", "public function getState() {}", "public function getState() {}", "public function getState() {}", "final public function getState() {\n return $this->state;\n }", "public static function getStates() {\n $db = Zend_Registry::get('dbAdapterReadOnly');\n $select = $db->select()\n ->from(array('ps' => 'printer_states'))\n ->order('ps.id');\n\n return $db->fetchAll($select);\n }" ]
[ "0.67806", "0.6576226", "0.6572894", "0.65708417", "0.6479763", "0.6455002", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.6399605", "0.63985413", "0.63791454", "0.6315753", "0.63057804", "0.63030994", "0.63029367", "0.6302337", "0.62340856", "0.61877584" ]
0.7338602
0
Check normal states exists
public function hasNormal() { return !empty($this->normalStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(4);\n }", "function validstates($state)\n{\n global $f3;\n return in_array($state, $f3->get('states'));\n}", "public function hasState() {\n return $this->_has(4);\n }", "public function hasInitial()\n {\n return !empty($this->initialStates);\n }", "public function isNewStates()\n {\n if ($this->isNonexistent) return false;\n\n return !!$this->countNewStates();\n }", "function validState($state)\r\n {\r\n return in_array($state, $this->_dataLayer->getStates());\r\n }", "abstract public function states();", "public function isNormal() {\n return $this->getStatus() === Status::NORMAL;\n }" ]
[ "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.64594126", "0.6358058", "0.62889266", "0.62737095", "0.6157419", "0.6120505", "0.60137266", "0.580777" ]
0.69411725
0
Get all normal states
public function getNormal() { return $this->hasNormal() ? array_values($this->normalStates) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStates(): array\n {\n return $this->states;\n }", "public function getStates() {\n return $this->state;\n }", "public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FULL_NAME])\n ->distinct()\n ->where('region', '!=', \" \")\n ->orderBy(self::C_STATE)\n ->get();\n\n foreach ($values as $value) {\n $states[$value->state] = $value->stateFullName;\n }\n\n return $states;\n }", "public static function getStates() {\n $db = Zend_Registry::get('dbAdapterReadOnly');\n $select = $db->select()\n ->from(array('ps' => 'printer_states'))\n ->order('ps.id');\n\n return $db->fetchAll($select);\n }", "abstract public function states();", "public function getStates() {\n return $this->createQuery()\n ->select(\"DISTINCT c.state\")\n ->from(\"Companies_Model_Company c\")\n ->whereIn(\"c.status\", Companies_Model_Company::getActiveStatuses())\n ->andWhere(\"c.local_business\")\n ->orderBy(\"c.state ASC\")\n ->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n }", "public function fetchAll()\n\t{\n\t\t$states = $this->getStatesModel()->fetchAll();\n\t\treturn $states;\n\t}", "public function getStateList() {\n $states = State::latest()->paginate(10);\n return $states;\n }", "public function getStates(): StateSet;", "public function getStates() {\n\t\treturn empty( $this->container['states'] ) ? null : $this->container['states'];\n\t}", "public function getFromStates() {\n return $this->fromStates;\n }", "public static function get_all_states()\n {\n $query = new Query;\n return $query->select(['core_states.*','core_zones.zone_name'])->from('core_states')\n ->innerJoin('core_zones','core_states.zone_id = core_zones.zone_id')\n ->orderBy(['core_states.state_name' => SORT_ASC])->All();\n }", "public static function getStates()\n {\n return array('ACTIVE', 'DISABLED', 'DELETED');\n }", "function getStates(){\n\t\tApp::import('Model', 'State');\n\t\t$this->State = new State();\n\t\t$stateArr = array();\n\t\t$stateArr = $this->State->find('list',array(\n\t\t\t'fields'=>array('State.state_code','State.name'),\n\t\t\t'order'=>array('State.name')\n\t\t\t));\n\t\treturn $stateArr;\n\t}", "public static function us_states(): array\n\t{\n\t\treturn ArrayLists::us_states();\n\t}", "public function state(): array;", "protected function state_all() {\n return $this->_views->all_json();\n }", "public function getStateList()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('state');\n\t\t$this->db->where('state_status', '1');\n\t\t$query = $this->db->get();\n\t\treturn $query->result() ;\n\t}", "public function getStatesList() {\n \t$user = Auth::user();\n \t$states = $user->states->sortBy('type_id');\n \treturn $states;\n }", "public function getStates() {\n\t\t$statement = $this->database->prepare(\"SELECT * FROM tbl_state\");\n\t\t$statement->execute();\n\t\t$results = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n\t\treturn $results ? $results : false;\n\t}", "public function enumStates()\n {\n $rVal = [];\n foreach ($this->xml->xpath('state') as $node) {\n $rVal[] = (string)$node[0]->attributes()->value;\n }\n\n return $rVal;\n }", "function getstates() {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT abbreviation as state, name FROM states\");\n\t\t$sql->execute();\n\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function getStateList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('state');\r\n\t\t$this->db->where('state_status', '1');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();" ]
[ "0.647964", "0.6424091", "0.63932616", "0.62895477", "0.6230935", "0.6228826", "0.62103736", "0.61879295", "0.6147332", "0.6135253", "0.61041045", "0.6073023", "0.605905", "0.5990167", "0.5959515", "0.59104687", "0.58974403", "0.5879883", "0.5875688", "0.58569294", "0.58413947", "0.58405256", "0.5835847", "0.5830262", "0.5830262", "0.5830262", "0.5830262", "0.5830262", "0.5830262", "0.5830262" ]
0.70630133
0
Creates a form to delete a role entity.
private function createDeleteForm(Roles $role) { return $this->createFormBuilder() ->setAction($this->generateUrl('back_roles_delete', array('id' => $role->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm(Role $role)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('role_delete', array('id' => $role->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }", "public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}", "function uc_roles_deletion_form($form, &$form_state, $account, $rid) {\n $expiration = db_query(\"SELECT expiration FROM {uc_roles_expirations} WHERE uid = :uid AND rid = :rid\", array(':uid' => $account->uid, ':rid' => $rid))->fetchField();\n if ($expiration) {\n\n $role_name = _uc_roles_get_name($rid);\n\n $form['user'] = array('#type' => 'value', '#value' => format_username($account->name));\n $form['uid'] = array('#type' => 'value', '#value' => $account->uid);\n $form['role'] = array('#type' => 'value', '#value' => $role_name);\n $form['rid'] = array('#type' => 'value', '#value' => $rid);\n\n $form = confirm_form(\n $form,\n t('Delete expiration of %role_name role for the user !user?', array(\n '!user' => theme('username', array(\n 'account' => $account,\n 'name' => check_plain($account->name),\n 'link_path' => 'user/' . $account->uid,\n )),\n '%role_name' => $role_name,\n )),\n 'admin/user/user/expiration',\n t('Deleting the expiration will give !user privileges set by the %role_name role indefinitely unless manually removed.', array(\n '!user' => theme('username', array(\n 'account' => $account,\n 'name' => check_plain($account->name),\n 'link_path' => 'user/' . $account->uid,\n )),\n '%role_name' => $role_name,\n )),\n t('Yes'),\n t('No')\n );\n }\n else {\n $form['error'] = array(\n '#markup' => t('Invalid user id or role id.'),\n );\n }\n\n return $form;\n}", "private function createDeleteForm(Event $event)\n {\n // $this->enforceUserSecurity('ROLE_USER');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('slug' => $event->getSlug())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "function roleDelete(Role $role);", "private function createDeleteForm(Efunction $efunction)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('efunction_delete', array('id' => $efunction->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Acte $acte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acte_delete', array('id' => $acte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function postDeleteRole(DeleteRequest $request)\n {\n $id = \\Input::get('id');\n // $student = Student::find($id);\n $gen_user_role = GenUserRole::find($id);\n $gen_user_role->delete();\n return redirect('gen_user');\n }", "public function deleting(Role $role)\n {\n }", "private function createDeleteForm(MostraMizaUllirit $mostraMizaUllirit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mostramizaullirit_delete', array('id' => $mostraMizaUllirit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n //\n if($role->name ==\"app-admin\"){\n\n }else{\n $role->delete();\n }\n return redirect('roles');\n }", "public function getForm()\n {\n return new RoleForm;\n }", "private function createDeleteForm(Events $event) {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('events_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ArmasMedico $armasMedico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('armasmedico_delete', array('id' => $armasMedico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RhythmMaterial $rhythmMaterial)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rhythmmaterial_delete', array('id' => $rhythmMaterial->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Projecte $projecte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('projecte_delete', array('id' => $projecte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Musicien $musicien)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('musicien_delete', array('codeMusicien' => $musicien->getCodemusicien())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }", "private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function executeDelete()\n {\n if($this->hasRequestParameter('ids')){\n $roles = array_reverse(RolePeer::retrieveByPKs(json_decode($this->getRequestParameter('ids'))));\n\n foreach($roles as $role){\n\t$role->delete();\n }\n\n }elseif($this->hasRequestParameter('id')){\n $role = RolePeer::retrieveByPk($this->getRequestParameter('id'));\n $role->delete();\n }\n\n $this->msg_alert = array('info', $this->getContext()->getI18N()->__(\"Rol borrado.\"));\n return $this->renderComponent('roles', 'list');\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(Recette $recette)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('recette_delete', array('id' => $recette->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Team $entity)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('app_team_delete', array('id' => $entity->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }", "function travel_delete_form($form, &$form_state, $entity) {\n // Store the entity in the form.\n $form_state['entity'] = $entity;\n\n // Show confirm dialog.\n $entity_uri = entity_uri('travel', $entity);\n $message = t('Are you sure you want to delete entity %title?', array('%title' => entity_label('travel', $entity)));\n return confirm_form(\n $form,\n $message,\n $entity_uri['path'],\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}" ]
[ "0.79986936", "0.69734687", "0.69086474", "0.6816056", "0.6799801", "0.6702436", "0.6464739", "0.64358765", "0.6387753", "0.6355804", "0.63335204", "0.63201606", "0.63201606", "0.63201606", "0.63067895", "0.6303177", "0.62701714", "0.62513304", "0.6242807", "0.62261164", "0.6204073", "0.6181939", "0.6166027", "0.61537284", "0.6152475", "0.61454445", "0.61361235", "0.6128081", "0.6126932", "0.61123484" ]
0.80152273
0
/ Plugin Name: My Custom WP Functions Description: Custom Additionals Author: David Mchale Author URI: / Unregister default widgets.
function custom_unregister_default_widgets() { unregister_widget( 'WP_Widget_Archives' ); unregister_widget( 'WP_Widget_Calendar' ); unregister_widget( 'WP_Widget_Categories' ); unregister_widget( 'WP_Widget_Meta' ); unregister_widget( 'WP_Widget_Pages' ); unregister_widget( 'WP_Widget_Recent_Comments' ); unregister_widget( 'WP_Widget_Recent_Posts' ); unregister_widget( 'WP_Widget_RSS' ); unregister_widget( 'WP_Widget_Search' ); unregister_widget( 'WP_Nav_Menu_Widget' ); unregister_widget( 'WP_Widget_Tag_Cloud' ); unregister_widget( 'Akismet_Widget' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unregister_default_widgets() {\n\t\\add_action( 'widgets_init', 'WPS\\_unregister_default_widgets' );\n}", "function unregister_default_wp_widgets() {\n unregister_widget('WP_Widget_Archives');\n unregister_widget('WP_Widget_Calendar');\n unregister_widget('WP_Widget_Categories');\n unregister_widget('WP_Widget_Meta');\n unregister_widget('WP_Widget_Pages');\n unregister_widget('WP_Widget_Recent_Comments');\n unregister_widget('WP_Widget_Recent_Posts');\n unregister_widget('WP_Widget_RSS');\n unregister_widget('WP_Widget_Links');\n unregister_widget('WP_Widget_Search');\n}", "function unregister_default_wp_widgets() {\n unregister_widget('WP_Widget_Pages');\n unregister_widget('WP_Widget_Calendar');\n unregister_widget('WP_Widget_Archives');\n unregister_widget('WP_Widget_Links');\n unregister_widget('WP_Widget_Meta');\n unregister_widget('WP_Widget_Search');\n unregister_widget('WP_Widget_Text');\n unregister_widget('WP_Widget_Categories');\n unregister_widget('WP_Widget_Recent_Posts');\n unregister_widget('WP_Widget_Recent_Comments');\n unregister_widget('WP_Widget_RSS');\n unregister_widget('WP_Widget_Tag_Cloud');\n unregister_widget('WP_Nav_Menu_Widget');\n}", "function unregister_default_widgets() {\n\tunregister_widget('WP_Widget_Pages');\n\tunregister_widget('WP_Widget_Calendar');\n\tunregister_widget('WP_Widget_Archives');\n\tunregister_widget('WP_Widget_Links');\n\tunregister_widget('WP_Widget_Meta');\n\tunregister_widget('WP_Widget_Search');\n\tunregister_widget('WP_Widget_Text');\n\tunregister_widget('WP_Widget_Categories');\n\tunregister_widget('WP_Widget_Recent_Posts');\n\tunregister_widget('WP_Widget_Recent_Comments');\n\tunregister_widget('WP_Widget_RSS');\n\tunregister_widget('WP_Widget_Tag_Cloud');\n\tunregister_widget('WP_Nav_Menu_Widget');\n\tunregister_widget('Twenty_Eleven_Ephemera_Widget');\n\tunregister_widget( 'Jetpack_Subscriptions_Widget' );\n\tunregister_widget( 'WPCOM_Widget_Facebook_LikeBox' );\n\tunregister_widget( 'Jetpack_Gallery_Widget' );\n\tunregister_widget( 'Jetpack_Gravatar_Profile_Widget' );\n\tunregister_widget( 'Jetpack_Image_Widget' );\n\tunregister_widget( 'Jetpack_Readmill_Widget' );\n\tunregister_widget('Jetpack_RSS_Links_Widget');\n\tunregister_widget( 'Jetpack_Top_Posts_Widget' );\n\tunregister_widget( 'Jetpack_Twitter_Timeline_Widget' );\n\tunregister_widget( 'Jetpack_Display_Posts_Widget' );\n\tunregister_widget( 'constant_contact_form_widget' );\n\tunregister_widget( 'constant_contact_events_widget' );\n\tunregister_widget( 'constant_contact_api_widget' );\n\tunregister_widget( 'bcn_widget' );\n}", "function unregister_default_wp_widgets() {\n\tif ( !is_blog_installed() )\n\t\treturn;\n\n\tunregister_widget('WP_Widget_Pages');\n\n\tunregister_widget('WP_Widget_Calendar');\n\n\tunregister_widget('WP_Widget_Archives');\n\n\tunregister_widget('WP_Widget_Links');\n\n\tunregister_widget('WP_Widget_Meta');\n\n\tunregister_widget('WP_Widget_Search');\n\n\tunregister_widget('WP_Widget_Text');\n\n\tunregister_widget('WP_Widget_Categories');\n\n\tunregister_widget('WP_Widget_Recent_Posts');\n\n\tunregister_widget('WP_Widget_Recent_Comments');\n\n\tunregister_widget('WP_Widget_RSS');\n\n\tunregister_widget('WP_Widget_Tag_Cloud');\n\n\tunregister_widget('WP_Nav_Menu_Widget');\n\n\tdo_action('widgets_init');\n}", "function my_custom_dashboard_widgets() \n \t{\n\t\tglobal $wp_meta_boxes;\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n\n\t\tunregister_sidebar( 'primary-widget-area' );\n\t\tunregister_sidebar( 'secondary-widget-area' );\n\t\tunregister_sidebar( 'first-footer-widget-area' );\n\t\tunregister_sidebar( 'second-footer-widget-area' );\n\t\tunregister_sidebar( 'third-footer-widget-area' );\n\t\tunregister_sidebar( 'fourth-footer-widget-area' );\n }", "function genesisawesome_custom_widgets() {\n\n\t/* Unregister Header Right widget area */\n\tunregister_sidebar( 'header-right' );\n\n\t/* Register Custom Widgets */\n\tregister_widget( 'GA_Facebook_Likebox_Widget' );\n\tregister_widget( 'GA_Flickr_Widget' );\n\n}", "function my_unregister_widgets() {\n\tunregister_widget( 'WP_Widget_Pages' );\n\tunregister_widget( 'WP_Widget_Calendar' );\n\tunregister_widget( 'WP_Widget_Archives' );\n\tunregister_widget( 'WP_Widget_Links' );\n\tunregister_widget( 'WP_Widget_Categories' );\n\tunregister_widget( 'WP_Widget_Recent_Posts' );\n\tunregister_widget( 'WP_Widget_Search' );\n\tunregister_widget( 'WP_Widget_Tag_Cloud' );\n\tunregister_widget( 'WP_Widget_Meta' );\n\tunregister_widget( 'WP_Widget_Recent_Comments' );\n\tunregister_widget( 'WP_Widget_RSS' );\n\n}", "function my_unregister_widgets() {\n\tunregister_widget('WP_Widget_Pages');\n\tunregister_widget('WP_Widget_Calendar');\n\tunregister_widget('WP_Widget_Archives');\n\tunregister_widget('WP_Widget_Meta');\n\tunregister_widget('WP_Widget_Search');\n\tunregister_widget('WP_Widget_Text');\n\tunregister_widget('WP_Widget_Categories');\n\tunregister_widget('WP_Widget_Recent_Posts');\n\tunregister_widget('WP_Widget_Recent_Comments');\n\tunregister_widget('WP_Widget_RSS');\n\tunregister_widget('WP_Widget_Tag_Cloud');\n\tunregister_widget('WP_Nav_Menu_Widget');\n}", "function my_unregister_widgets() {\n unregister_widget('WP_Widget_Archives');\n unregister_widget('WP_Widget_Links');\n unregister_widget('WP_Widget_Meta');\n unregister_widget('WP_Widget_Recent_Posts');\n unregister_widget('WP_Widget_Recent_Comments');\n unregister_widget('WP_Widget_RSS');\n unregister_widget('WP_Widget_Calendar');\n}", "function wporg_add_dashboard_widgets() {\r\n // Remove Welcome panel\r\n remove_action( 'welcome_panel', 'wp_welcome_panel' );\r\n // Remove the rest of the dashboard widgets\r\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\r\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\r\n remove_meta_box( 'health_check_status', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');\r\n remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal');\r\n \r\n // Add function here\r\n wp_add_dashboard_widget( 'jerome-on-service-widget', 'Web Developer Service Tag', 'jerome_on_service_widget');\r\n}", "function wp_unregister_widget_control($id)\n {\n }", "function lose_the_widgets ()\r\n{\r\n unregister_sidebar( 'sidebar-1' );\r\n unregister_sidebar( 'sidebar-2' );\r\n unregister_sidebar( 'sidebar-3' );\r\n}", "function remove_widgets(){\r\n remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); \r\n remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); \r\n remove_meta_box('dashboard_activity', 'dashboard', 'normal'); \r\n remove_meta_box('dashboard_primary', 'dashboard', 'side'); \r\n remove_meta_box('dashboard_site_health', 'dashboard', 'side'); \r\n \r\n // Eliminar widget de Elementor que aparece al activar su plugin\r\n remove_meta_box('e-dashboard-overview', 'dashboard', 'normal'); \r\n}", "function unregister_wp_widgets() {\n\t$widgets = [\n\t\t'WP_Widget_Pages',\n\t\t'WP_Widget_Calendar',\n\t\t'WP_Widget_Archives',\n\t\t// Links Manager and its Widget is unregistered already since 3.5.\n\t\t// 'WP_Widget_Links',\n\t\t'WP_Widget_Meta',\n\t\t'WP_Widget_Search',\n\t\t'WP_Widget_Text',\n\t\t'WP_Widget_Categories',\n\t\t'WP_Widget_Recent_Posts',\n\t\t'WP_Widget_Recent_Comments',\n\t\t'WP_Widget_RSS',\n\t\t'WP_Widget_Tag_Cloud',\n\t\t'WP_Nav_Menu_Widget',\n\t];\n\n\tforeach ( $widgets as $widget ) {\n\t\tunregister_widget( $widget );\n\t}\n}", "function wp_unregister_sidebar_widget($id)\n {\n }", "function deregister_widgets()\n { foreach ( $this->get_widgets() as $widget )\n {\n unregister_widget( $widget );\n }\n\n }", "function remove_business_starter_widgets(){\n\n\tunregister_sidebar( 'sidebar-1' );\n\tunregister_sidebar( 'sidebar-2' );\n\tunregister_sidebar( 'sidebar-3' );\n}", "function _wp_remove_unregistered_widgets($sidebars_widgets, $allowed_widget_ids = array())\n {\n }", "function remove_woo_widgets() {\n unregister_widget( 'WC_Widget_Recent_Products' );\n unregister_widget( 'WC_Widget_Featured_Products' );\n unregister_widget( 'WC_Widget_Products' );\n unregister_widget( 'WC_Widget_Product_Categories' );\n unregister_widget( 'WC_Widget_Product_Tag_Cloud' );\n unregister_widget( 'WC_Widget_Cart' );\n unregister_widget( 'WC_Widget_Layered_Nav' );\n unregister_widget( 'WC_Widget_Layered_Nav_Filters' );\n //unregister_widget( 'WC_Widget_Price_Filter' );\n unregister_widget( 'WC_Widget_Top_Rated_Products' );\n unregister_widget( 'WC_Widget_Recent_Reviews' );\n unregister_widget( 'WC_Widget_Recently_Viewed' );\n unregister_widget( 'WC_Widget_Best_Sellers' );\n unregister_widget( 'WC_Widget_Onsale' );\n //unregister_widget( 'WC_Widget_Random_Products' );\n}", "function unregister_sidebar_widget($id)\n {\n }", "function hocwp_theme_custom_widgets_init() {\r\n\r\n}", "function templ_remove_dashboard_widgets()\r\n{\r\n /* Globalize the metaboxes array, this holds all the widgets for wp-admin*/\r\n global $wp_meta_boxes;\r\n /* Remove the Dashboard quickpress widget*/\r\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\r\n /* Remove the Dashboard incoming links widget*/\r\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\r\n /* Remove the Dashboard secondary widget*/\r\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\r\n}", "function owlride_disable_default_dashboard_widgets() {\n remove_meta_box('dashboard_plugins', 'dashboard', 'core');\n remove_meta_box('dashboard_quick_press', 'dashboard', 'core');\n remove_meta_box('dashboard_primary', 'dashboard', 'core');\n remove_meta_box('dashboard_secondary', 'dashboard', 'core');\n}", "function dwc_setup_widgets() {\n\tregister_sidebar( array(\n\t\t'id' => 'first-footer-widget-area',\n\t\t'name' => 'First Footer Widget Area',\n\t\t'description' => 'Widgets in this area will be shown in the footer area.',\n\t\t'before_widget' => '<div class=\"widget %2$s\">',\n\t\t'after_widget' => '</div><!-- .widget -->',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\n\t// Unregister these since the child theme doesn't use them\n\tunregister_sidebar( 'primary-widget-area' );\n\tunregister_sidebar( 'secondary-widget-area' );\n\tunregister_sidebar( 'second-footer-widget-area' );\n\tunregister_sidebar( 'third-footer-widget-area' );\n\tunregister_sidebar( 'fourth-footer-widget-area' );\n}", "function fp_remove_default_dashboard_widgets() { \n\tremove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n /*remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');*/\n}", "function init_custom_widgets() {\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-top',\n\t\t'name' => __('Sidebar top', 'bonestheme'),\n\t\t'description' => __('Top sidebar area, present on all pages (default: Main Menu)', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-projects',\n\t\t'name' => __('Projects sidebar', 'bonestheme'),\n\t\t'description' => __('Active on single project pages only (default: Related People, Grants & Publications)', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-people',\n\t\t'name' => __('People sidebar', 'bonestheme'),\n\t\t'description' => __('Active on single people pages only.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-homepage',\n\t\t'name' => __('Homepage sidebar', 'bonestheme'),\n\t\t'description' => __('Active on homepage, lower side bar area.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-homepage-content',\n\t\t'name' => __('Homepage main', 'bonestheme'),\n\t\t'description' => __('Active on homepage, below main content area.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>'\n\t));\n\t\n\t\n\n\t/* Custom widget's */\n\t\n\tregister_widget( 'All_People_Widget' );\n\tregister_widget( 'Related_People_Widget' );\n\n\tregister_widget( 'All_Projects_Widget' );\n\tregister_widget( 'Related_Projects_Widget' );\n\tregister_widget( 'Related_Grants_Widget' );\n\tregister_widget( 'Related_Publications_Widget' );\n\n}", "function theme_widgets_init() {\n register_sidebar(array(\n 'name' => __('Main Widget Area', 'theme'),\n 'id' => 'sidebar-1',\n 'description' => __('Appears in the footer section of the site.', 'law-firm'),\n 'before_widget' => '',\n 'after_widget' => '',\n 'before_title' => '',\n 'after_title' => '<',\n ));\n\n register_sidebar(array(\n 'name' => __('Secondary Widget Area', 'theme'),\n 'id' => 'sidebar-2',\n 'description' => __('Appears on posts and pages in the sidebar.', 'law-firm'),\n 'before_widget' => '',\n 'after_widget' => '',\n 'before_title' => '',\n 'after_title' => '',\n ));\n}", "function remove_unused_widgets() {\n\tunregister_widget( 'WP_Widget_Meta' );\n\tunregister_widget( 'WP_Widget_Calendar' );\n\tunregister_widget( 'WP_Widget_Recent_Comments' );\n\tunregister_widget( 'WP_Widget_Tag_Cloud' );\n}", "function ourWidgetsInit() {\n // register widget location\n register_sidebar( array(\n 'name' => 'Sidebarr',\n 'id' => 'sidebar1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"a-special-class\">',\n 'after_title' => '</h2>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 1',\n 'id' => 'footer1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 2',\n 'id' => 'footer2',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 3',\n 'id' => 'footer3',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 4',\n 'id' => 'footer4',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n}" ]
[ "0.8636281", "0.8197421", "0.81720716", "0.79573977", "0.7938502", "0.7928548", "0.79066247", "0.78764915", "0.7800305", "0.77646667", "0.7620833", "0.75784874", "0.7419697", "0.73724735", "0.7340547", "0.7312976", "0.72826034", "0.72666377", "0.72553134", "0.72380036", "0.72191375", "0.7173956", "0.7127451", "0.7111148", "0.7101804", "0.70884454", "0.7060082", "0.7020396", "0.70175517", "0.69481397" ]
0.8350835
1
/ Hide dashboard widgets.
function custom_hide_dashboard_widgets() { global $wp_meta_boxes; // Today widget. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] ); // Last comments. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] ); // Incoming links. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] ); // Plugins. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] ); // WordPress blog. unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); // WordPress news. unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mitlibnews_remove_dashboard_widgets() {\n\tremove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // Quickpress widget\n\tremove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // Wordpress news\n\tif (!current_user_can('add_users')) {\n\t\tremove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); // \"At a glance\" widget\n\t\tremove_meta_box( 'dashboard_activity', 'dashboard', 'normal'); // Activity widget\n\t}\n}", "function rad_remove_dash_widgets(){\n\tremove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n\tremove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n}", "function fabric_remove_dashboard_widgets() {\n remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');\n remove_meta_box('dashboard_plugins', 'dashboard', 'normal');\n remove_meta_box('dashboard_primary', 'dashboard', 'normal');\n remove_meta_box('dashboard_secondary', 'dashboard', 'normal');\n}", "function admin_disable_dashboard_widgets() {\n // remove_meta_box('dashboard_right_now', 'dashboard', 'normal');// Remove \"At a Glance\"\n // remove_meta_box('dashboard_activity', 'dashboard', 'normal');// Remove \"Activity\" which includes \"Recent Comments\"\n // remove_meta_box('dashboard_quick_press', 'dashboard', 'side');// Remove Quick Draft\n remove_meta_box('dashboard_primary', 'dashboard', 'core');// Remove WordPress Events and News\n}", "function dwwp_remove_dashboard_widget() {\n remove_meta_box( 'dashboard_primary','dashboard','side' );\n}", "function remove_dashboard_widgets() {\n\tremove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n\tremove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );\n\t// remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );\n\tremove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );\n}", "function maker_4ym_remove_dashboard_widgets() {\n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );\n}", "public function remove_dashboard_widgets() {\n\t\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');\n\t\tremove_meta_box('dashboard_plugins', 'dashboard', 'normal');\n\t\tremove_meta_box('dashboard_primary', 'dashboard', 'normal');\n\t\tremove_meta_box('dashboard_secondary', 'dashboard', 'normal');\n\t}", "function cmk_disable_default_dashboard_widgets() {\n remove_meta_box('dashboard_plugins', 'dashboard', 'core');\n remove_meta_box('dashboard_primary', 'dashboard', 'core');\n remove_meta_box('dashboard_secondary', 'dashboard', 'core'); // disable Simple:Press dashboard widget\n remove_meta_box('sf_announce', 'dashboard', 'normal');\n}", "function disable_tribe_dashboard_widget() {\n remove_meta_box('tribe_dashboard_widget', 'dashboard', 'normal');\n}", "function kcsite_remove_dashboard_widgets() {\n\t\t// remove_meta_box('yoast_db_widget', 'dashboard', 'normal'); // Breadcrumbs\n\t\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // incoming links\n\t\t//remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // plugins\n\t\tremove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); // plugins\n\t\t//remove_meta_box('dashboard_quick_press', 'dashboard', 'normal'); // quick press\n\t \tremove_meta_box('dashboard_recent_drafts', 'dashboard', 'normal'); // recent drafts\n\t \tremove_meta_box('dashboard_primary', 'dashboard', 'normal'); // wordpress blog\n\t \tremove_meta_box('dashboard_secondary', 'dashboard', 'normal'); // other wordpress news\n\t \tremove_meta_box('alo-easymail-widget', 'dashboard', 'normal'); // other wordpress news\n\t \tremove_meta_box('tribe_dashboard_widget', 'dashboard', 'normal'); // other wordpress news\n\t}", "function mtws_remove_dashboard_widgets() {\n //remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );\n\tremove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\n}", "function templ_remove_dashboard_widgets()\r\n{\r\n /* Globalize the metaboxes array, this holds all the widgets for wp-admin*/\r\n global $wp_meta_boxes;\r\n /* Remove the Dashboard quickpress widget*/\r\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\r\n /* Remove the Dashboard incoming links widget*/\r\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\r\n /* Remove the Dashboard secondary widget*/\r\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\r\n}", "function owlride_disable_default_dashboard_widgets() {\n remove_meta_box('dashboard_plugins', 'dashboard', 'core');\n remove_meta_box('dashboard_quick_press', 'dashboard', 'core');\n remove_meta_box('dashboard_primary', 'dashboard', 'core');\n remove_meta_box('dashboard_secondary', 'dashboard', 'core');\n}", "function wptutsplus_remove_dashboard_widgets() {\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );\n // remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n}", "function remove_widgets(){\r\n remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); \r\n remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); \r\n remove_meta_box('dashboard_activity', 'dashboard', 'normal'); \r\n remove_meta_box('dashboard_primary', 'dashboard', 'side'); \r\n remove_meta_box('dashboard_site_health', 'dashboard', 'side'); \r\n \r\n // Eliminar widget de Elementor que aparece al activar su plugin\r\n remove_meta_box('e-dashboard-overview', 'dashboard', 'normal'); \r\n}", "public function disable_dashboard_widgets() {\n\n\t\t//Init vars\n\t\t$defaults = array(\n\t\t\t'id' \t\t=> NULL,\n\t\t\t'page'\t\t=> 'dashboard',\n\t\t\t'context'\t=> NULL\n\t\t);\n\n\t\t//Check if disable_dashboard_widgets array isset in config class\n\t\tif( isset($this->admin_disable_dashboard_widgets) && is_array($this->admin_disable_dashboard_widgets) ) {\n\n\t\t\t//Loop each request and call WP remove_meta_box for each\n\t\t\tforeach( $this->admin_disable_dashboard_widgets as $method_args ) {\n\n\t\t\t\t$method_args = wp_parse_args( $method_args, $defaults );\n\n\t\t\t\tif( isset( $method_args['id'], $method_args['page'], $method_args['context'] ) ) {\n\t\t\t\t\tremove_meta_box( $method_args['id'], $method_args['page'], $method_args['context'] );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function remove_dashboard_widgets() {\n // Remove All Dashboard Widgets.\n remove_action('welcome_panel', 'wp_welcome_panel'); \n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); \n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); \n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); \n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); \n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); \n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); \n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );\n remove_meta_box('logincust_subscribe_widget', 'dashboard', 'core');\n remove_meta_box('themeisle', 'dashboard', 'core'); \n}", "function my_remove_dashboard_widgets() {\n $user = wp_get_current_user();\n if ( ! $user->has_cap( 'manage_options' ) ) {\n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n }\n}", "function rw_remove_dashboard_widgets() {\n//\tremove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); // Recent Comments\n\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // Incoming Links\n\tremove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // Plugins\n\n\tremove_meta_box('dashboard_quick_press', 'dashboard', 'normal'); // Quick Press\n//\tremove_meta_box('dashboard_recent_drafts', 'dashboard', 'normal'); // Recent Drafts\n\tremove_meta_box('dashboard_primary', 'dashboard', 'normal'); // Wordpress Blog\n\tremove_meta_box('dashboard_secondary', 'dashboard', 'normal'); // Other Wordpress News\n}", "function example_remove_dashboard_widgets() {\n\t \tglobal $wp_meta_boxes;\n\n\t\t// Remove the incomming links widget\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\t\n\n\t\t// Remove right now\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n\n\t\t// Remove side column\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);\n\t}", "function my_custom_dashboard_widgets() \n \t{\n\t\tglobal $wp_meta_boxes;\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n\n\t\tunregister_sidebar( 'primary-widget-area' );\n\t\tunregister_sidebar( 'secondary-widget-area' );\n\t\tunregister_sidebar( 'first-footer-widget-area' );\n\t\tunregister_sidebar( 'second-footer-widget-area' );\n\t\tunregister_sidebar( 'third-footer-widget-area' );\n\t\tunregister_sidebar( 'fourth-footer-widget-area' );\n }", "function disable_default_dashboard_widgets() {\n\tremove_meta_box('dashboard_right_now', 'dashboard', 'core');\n\tremove_meta_box('dashboard_recent_comments', 'dashboard', 'core');\n\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'core');\n\tremove_meta_box('dashboard_plugins', 'dashboard', 'core');\n\n\tremove_meta_box('dashboard_quick_press', 'dashboard', 'core');\n\tremove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');\n\tremove_meta_box('dashboard_primary', 'dashboard', 'core');\n\tremove_meta_box('dashboard_secondary', 'dashboard', 'core');\n}", "function disable_default_dashboard_widgets() {\r\n remove_meta_box('dashboard_recent_comments', 'dashboard', 'core'); // Comments Widget\r\n remove_meta_box('dashboard_incoming_links', 'dashboard', 'core'); // Incoming Links Widget\r\n remove_meta_box('dashboard_activity', 'dashboard', 'core'); // welcome panel\r\n remove_meta_box('dashboard_plugins', 'dashboard', 'core'); // Plugins Widget\r\n Remove_meta_box('dashboard_quick_press', 'dashboard', 'core'); // Quick Press Widget\r\n remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core'); // Recent Drafts Widget\r\n remove_meta_box('dashboard_primary', 'dashboard', 'core'); //\r\n remove_meta_box('dashboard_secondary', 'dashboard', 'core'); //\r\n // Removing plugin dashboard boxes\r\n remove_meta_box('yoast_db_widget', 'dashboard', 'normal'); // Yoast's SEO Plugin Widget\r\n}", "function mmc_dashboard(){\n\tremove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n\tremove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n}", "public function hidden_sidebars() {\n\t\techo '<div style=\"display: none\">';\n\t\tif ( is_customize_preview() ) {\n\t\t\tdynamic_sidebar( 'sidebar-top-bar' );\n\t\t\tdynamic_sidebar( 'header-sidebar' );\n\t\t\tdynamic_sidebar( 'subscribe-widgets' );\n\t\t\tdynamic_sidebar( 'sidebar-big-title' );\n\t\t}\n\t\techo '</div>';\n\t}", "function remove_dashboard_widgets() {\n global $wp_meta_boxes;\n \n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);\n remove_action( 'welcome_panel', 'wp_welcome_panel' );\n \n}", "public function remove_dashboard_widgets() {\n remove_meta_box(\"dashboard_primary\", \"dashboard\", \"side\"); // WordPress.com blog\n remove_meta_box(\"dashboard_secondary\", \"dashboard\", \"side\"); // Other WordPress news\n\n global $wp_meta_boxes;\n\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n }", "function remove_business_starter_widgets(){\n\n\tunregister_sidebar( 'sidebar-1' );\n\tunregister_sidebar( 'sidebar-2' );\n\tunregister_sidebar( 'sidebar-3' );\n}", "function fp_remove_default_dashboard_widgets() { \n\tremove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n /*remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');*/\n}" ]
[ "0.76082855", "0.75985193", "0.75888413", "0.75827056", "0.7523026", "0.75071985", "0.750256", "0.7469566", "0.74597436", "0.74109954", "0.74072343", "0.7404851", "0.7344693", "0.730992", "0.7305711", "0.7291481", "0.7274372", "0.7229942", "0.7209446", "0.7188029", "0.7165178", "0.71119153", "0.7068923", "0.7060138", "0.7024644", "0.70119184", "0.69594544", "0.6924699", "0.689154", "0.6881178" ]
0.76435626
0
Check whether provider provider id/name is valid
public static function isProviderValid($provider) { return array_key_exists($provider, static::$providers); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkProviderKey($provider) {\n\n $postdata = http_build_query(\n array(\n 'ptype' => 'check-provider-key',\n 'provider_url' => $provider['provider_url'],\n 'provider_key' => $provider['provider_key']\n )\n );\n \n $wgbacklinks = WgbacklinksHelper::getInstance();\n $result = $wgbacklinks->execExchangeData($provider['provider_url'], $postdata); \n\n return $result;\n \n }", "public static function hasProvider() {\n\t\treturn !is_null(self::$provider);\n\t}", "public function validProvider()\n {\n return array(\n // always valid all ones\n array('11111111111111111', true),\n // valid X check digit\n array('1M8GDM9AXKP042788', true),\n // typical valid vin\n array('5GZCZ43D13S812715', true),\n // invalid char in model year\n array('5GZCZ43D1US812715', false),\n // uses invalid I, O, Q\n array('IGZOZ43Q13S812715', false)\n );\n }", "public function hasProvider($type);", "public function getProviderName();", "public function getProviderName();", "public function getProviderName();", "public function hasProviders(): bool;", "public function hasProviders();", "public function get_provider($name)\n {\n }", "protected function validProvider($providerName)\n {\n $providers = json_decode(setting('social_auths'));\n\n if (!$providers->{$providerName}) {\n return false;\n }\n\n return $providers->{$providerName}->enabled;\n }", "private function checkProvider($idPchProvider)\n {\n $provider = PchProvider::whereId($idPchProvider)->whereFlagDelete(false)->first();\n if (!$provider) {\n throw new ValidationException(\"El proveedor ($idPchProvider) no existe.\");\n }\n return $provider;\n }", "public function create(Provider $provider)\n {\n\t if (Auth::guard('provider-web')->user()->id == $provider->id) return true;\n\t return false;\n }", "public function isProvider()\n {\n if ($this->type == 2) {\n return true;\n } else {\n return false;\n }\n }", "public function setProvider($name) {\n $name = Database::secureInput($name);\n\n if (!is_string($name) || strlen($name) < 2 || strlen($name) > 100) {\n throw new InvalidArgumentException(\"\\\"provider\\\" is no string or its length is invalid\");\n }\n\n $this->provider = $name;\n }", "public function getProviderName()\n {\n return NULL;\n }", "public function getProvider($provider_id);", "public function providerExists($providerName)\n {\n $query = $this->db->prepare('SELECT COUNT(id) FROM ? WHERE name = ?', array(\n self::TABLE_PROVIDERS,\n $providerName\n ));\n\n $count = $this->db->get_var($query);\n\n return (int) $count >= 1;\n }", "public function getProviderId();", "public function getProviderName(): string\n {\n return $this->providerName;\n }", "public static function cmpFqdnInvalidDataProvider() {}", "public function setProviderName($name);", "public function providerTestIsValidUsername() {\n return [\n 'valid' => [\n 'YesCT',\n TRUE,\n ],\n 'not valid' => [\n 'x x',\n FALSE,\n ],\n ];\n }", "public static function cmpFqdnValidDataProvider() {}", "public function getProviderName()\n {\n return $this->providerName;\n }", "public function isProviderOnline($provider = null): bool;", "public function hasProvider($name)\n {\n return isset($this->providers[$name]);\n }", "public function isValidMessengerProvider($provider = null): bool\n {\n return (bool) $this->findProviderAlias($provider);\n }", "public function hasIdentity($provider = null)\n {\n return !$this->getStorage()->isEmpty($provider);\n }", "protected function detectLoginProvider() {}" ]
[ "0.63221335", "0.62779325", "0.6265286", "0.6205485", "0.61896044", "0.61896044", "0.61896044", "0.60886633", "0.60876095", "0.60855556", "0.60406965", "0.60148853", "0.60049236", "0.5953346", "0.5939193", "0.59316665", "0.5893126", "0.585801", "0.5856962", "0.583204", "0.5819401", "0.5818838", "0.5768652", "0.5750044", "0.57389003", "0.5684394", "0.5662631", "0.56567615", "0.5650341", "0.5645111" ]
0.7011916
0
Get user sex or null if it is not set
public function getUserSex() { return $this->getUserAttribute(static::ATTRIBUTE_SEX); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSex()\n {\n $result = null;\n if (isset($this->userInfo['sex'])) {\n $result = $this->userInfo['sex'] == 1;\n }\n return $result;\n }", "public function getsex()\n {\n return $this->sex;\n }", "function getGender($userid) {\n return NULL;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex() {\n return (new Query())->select('sex')->from('user_cv')\n ->where(['user_id' => $this->id, 'is_default' => true])\n ->limit(1)->scalar();\n }", "public function getCsex()\n {\n return $this->csex;\n }", "public function getSex()\n {\n return self::SEX[$this->sex];\n }", "public function hasSex(){\n return $this->_has(2);\n }", "public function hasSex(){\n return $this->_has(2);\n }", "public function hasSex(){\n return $this->_has(3);\n }", "public function setSex($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->sex !== $v) {\n $this->sex = $v;\n $this->modifiedColumns[UserTableMap::COL_SEX] = true;\n }\n\n return $this;\n }", "public function hasSex(){\r\n return $this->_has(6);\r\n }", "public function getCustomerGender();", "public function getCustomerGender()\n {\n $user = Shopware()->Modules()->Admin()->sGetUserData();\n\n if (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '<')) {\n $customerGender = $user[\"billingaddress\"][\"salutation\"];\n } elseif (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '>=')) {\n $customerGender = $user[\"additional\"][\"user\"][\"salutation\"];\n }\n\n return $customerGender;\n }", "function getGender() {\n return $this->gender;\n }", "public function getGender()\n {\n return $this->getParameter('gender');\n }", "function vSex ( $sex ) \r\n\t\t{\r\n\t\t\t# Strip string down to first character\r\n\t\t\t$sex = strtolower( substr( $sex, 0, 1) );\r\n\t\t\t\r\n\t\t\t# Checks if result is 'f' or 'm'\r\n\t\t\tif ( $sex != \"f\" OR $sex != \"m\" )\r\n\t\t\t\t$sex = true;\r\n\t\t\t\t\r\n\t\t\telse \r\n\t\t\t\t$sex = false;\r\n\t\t\t\r\n\t\t\treturn $sex;\r\n\t\t\t\r\n\t\t}", "public function getGender()\n {\n return $this->gender;\n }", "public function getGender()\n {\n return $this->gender;\n }", "public function getGender()\n {\n return $this->gender;\n }", "public function getGender()\n {\n return $this->gender;\n }", "public function getGender(){\n $name = '';\n if ($this->gender =='N') {\n $name = 'Preferred not to tell';\n }elseif ($this->gender =='M') {\n $name = 'Male';\n }else{\n $name = 'Female';\n }\n return $name;\n }", "public function getGender(){ // fungsi get untuk mengambil nilai dari gender\n printNumC();//\n return $this->gender;\n }", "function female() \n { \n $this->sex_id=\"F\";\n $this->sex_name=\"Female\";\n return($this->sex_id);\n }", "public static function getTextGender($oUser)\n {\n $gender = null;\n switch ($oUser->gender) {\n case 'M':\n $gender = 'Homme';\n break;\n case 'F':\n $gender = 'Femme';\n break;\n }\n return $gender;\n }", "function isGenderUnknown() {\n\tglobal $USER;\n\tif(!isset($USER['gender'])) return true; //If we don't know guess they aren't\n if($USER['gender']==\"u\") {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}" ]
[ "0.7810267", "0.75179243", "0.72500116", "0.71574724", "0.71574724", "0.71574724", "0.71574724", "0.71574724", "0.6864054", "0.6777187", "0.6545667", "0.6400071", "0.6400071", "0.6380897", "0.63448596", "0.62781256", "0.62503695", "0.61736095", "0.6143012", "0.61328506", "0.6120611", "0.6076327", "0.6076327", "0.6076327", "0.6076327", "0.6062665", "0.6040551", "0.60386467", "0.60138345", "0.6004832" ]
0.76433337
1
Get user birthday in format dd.mm.YYYY or null if it is not set
public function getUserBirthday() { $result = $this->getUserAttribute(static::ATTRIBUTE_BIRTHDAY); if (!empty($result)) { return date('d.m.Y', strtotime($result)); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBirthdayDate():?string\n {\n return $this->birthday_date ? (new \\DateTime($this->birthday_date))->format('d/m/Y') : null;\n }", "public function getBirthDay() {\n \tif($this->birthDay == null)\n\t\t\treturn \"\";\n\t\telse\n \treturn $this->birthDay;\n }", "function getDayOfBirth() {\n global $USER;\n\t$dayOfBirth = date(\"d\", $USER['dob']);\n\treturn $dayOfBirth;\n}", "protected function getDateOfBirthAttribute()\n {\n if (isset($this->attributes['date_of_birth'])) {\n $value = $this->attributes['date_of_birth'] ?? null;\n } else {\n $value = null;\n }\n\n if ($value !== null) {\n return date('d.m.Y', strtotime($value));\n } else {\n return null;\n }\n }", "public function getBirthDate()\n {\n if ($this->birthDate) {\n return $this->birthDate;\n }\n\n $centuryCode = substr($this->personal_code, 0, 1);\n if ($centuryCode < 3) {\n $century = 19;\n } elseif ($centuryCode < 5) {\n $century = 20;\n } else {\n $century = 21;\n }\n\n $this->birthDate = new \\DateTime(($century - 1) . substr($this->personal_code, 1, 6));\n\n return $this->birthDate;\n }", "public function getBirthday() : string\r\n\t{\r\n\t\treturn $this->birthday;\r\n\t}", "public function getBirthday($format = 'Y-m-d')\n {\n $value = $this->getParameter('birthday');\n\n return $value ? $value->format($format) : null;\n }", "public function getDateOfBirth() {\n\t\treturn empty( $this->container['dates_of_birth'] ) ? null : $this->container['dates_of_birth'][0];\n\t}", "public function getBirthDate()\n {\n return $this->getProfile() ? $this->getProfile()->getBirthDate() : null;\n }", "public function getUserDateOfBirth () {\n\t\treturn ($this->userDateOfBirth);\n\t}", "public function getBirthDate()\n\t{\n\t\treturn $this->getIfSetDate('birthDate');\n\t}", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday($format = 'Y-m-d H:i:s')\n\t{\n\t\tif ($this->birthday === null) {\n\t\t\treturn null;\n\t\t}\n\n\n\t\tif ($this->birthday === '0000-00-00 00:00:00') {\n\t\t\t// while technically this is not a default value of NULL,\n\t\t\t// this seems to be closest in meaning.\n\t\t\treturn null;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$dt = new DateTime($this->birthday);\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException(\"Internally stored date/time/timestamp value could not be converted to DateTime: \" . var_export($this->birthday, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ($format === null) {\n\t\t\t// Because propel.useDateTimeClass is TRUE, we return a DateTime object.\n\t\t\treturn $dt;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $dt->format('U'));\n\t\t} else {\n\t\t\treturn $dt->format($format);\n\t\t}\n\t}", "public function getDateofBirth() {\n return $this->dateOfBirth;\n }", "public function getBirthdate()\n\t{\n\t\treturn $this->birthdate;\n\t}", "public function getBirthdate($format = 'Y-m-d')\n\t{\n\t\tif ($this->birthdate === null) {\n\t\t\treturn null;\n\t\t}\n\n\n\t\tif ($this->birthdate === '0000-00-00') {\n\t\t\t// while technically this is not a default value of NULL,\n\t\t\t// this seems to be closest in meaning.\n\t\t\treturn null;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$dt = new DateTime($this->birthdate);\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException(\"Internally stored date/time/timestamp value could not be converted to DateTime: \" . var_export($this->birthdate, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ($format === null) {\n\t\t\t// Because propel.useDateTimeClass is TRUE, we return a DateTime object.\n\t\t\treturn $dt;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $dt->format('U'));\n\t\t} else {\n\t\t\treturn $dt->format($format);\n\t\t}\n\t}", "public function getBirthDate()\n {\n return $this->birth_date;\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getBirthdate()\r\n {\r\n return $this->birthdate;\r\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getBirthDate() : Datetime\n {\n if (is_null($this->birthDate)) {\n $year = $this->getBirthCentury() + substr($this->code, 1, 2);\n $month = substr($this->code, 3, 2);\n $day = substr($this->code, 5, 2);\n\n $this->birthDate = new Datetime($year.'-'.$month.'-'.$day);\n }\n\n return $this->birthDate;\n }", "public function getBirthdayDate()\n {\n return $this->birthdayDate;\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getBirthday($format = 'd.m.Y.')\n {\n return date($format, $this->getBirthdayTimeStamp());\n }", "public function getBirthDate()\n {\n return $this->birthDate;\n }" ]
[ "0.81020474", "0.8087841", "0.78028715", "0.77632535", "0.7634923", "0.75612813", "0.7509031", "0.74697196", "0.74228454", "0.73496985", "0.7268432", "0.7224518", "0.7224518", "0.7224518", "0.7224518", "0.7224518", "0.72205245", "0.71527565", "0.7133127", "0.71291655", "0.7126509", "0.7122136", "0.7108115", "0.7067304", "0.7067304", "0.7059581", "0.70539707", "0.7014363", "0.70128477", "0.7005834" ]
0.8222234
0
Get all components required to build authentication url
abstract public function getAuthUrlComponents();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function auth_url();", "public function getAuthUrl();", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "abstract public function getAuthUri(): string;", "public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}", "public function getAuthUrl()\n\t{\n\t\treturn $this->createAuthUrl();\n\t}", "abstract protected function getAuthUrl($state);", "protected function _getAuthUrl()\n {\n\t\t$url = CS_REST_General::authorize_url(\n\t\t\t$this->_getClientId(),\n\t\t\t$this->_getAuthRedirectUri(),\n\t\t\t'ImportSubscribers,ManageLists'\n\t\t);\n\t\t\n return $url;\n }", "public function get_auth_url()\r\n\t{\r\n\t\treturn PicasaAPI::$QUERY_URLS['auth'];\r\n\t}", "public function get_auth_string()\n {\n }", "private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }", "function umnshib_buildLoginURL(array $options = array())\n{\n $shib = new BasicAuthenticator();\n return $shib->buildLoginURL($options);\n}", "public function getAuthUrl()\n {\n return $this->authUrl;\n }", "public function getAuthUrl()\n {\n return $this->authUrl;\n }", "public function authenticationURL()\n {\n $clientId = config('twitch-api.client_id');\n $scopes = implode('+', config('twitch-api.scopes'));\n $redirectURL = config('twitch-api.redirect_url');\n return config('twitch-api.api_url') . '/kraken/oauth2/authorize?api_version=5&response_type=code&client_id=' . $clientId . '&redirect_uri=' . $redirectURL . '&scope=' . $scopes;\n }", "public function getLoginUrl();", "public function getAuthUrl()\n {\n return $this->client->createAuthUrl();\n }", "public function getAuthUrl()\n {\n $return = $this->baseUrl .\n '/' . $this->authNamespace .\n '/' . $this->authVersion .\n '/token?url=' . $this->baseUrl . '/' . $this->apiNamespace;\n\n return $return;\n }", "public function buildPasswordUri(): string;", "abstract public function getAuthorizeUrl(): string;", "abstract protected function getTokenUrl();", "public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}", "public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}", "public function getAuth();", "public function getAuth();", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "public function buildLoginUrl(Request $request): string;", "function fsl_gauth_getauthurl()\n\t{\n\t\n\t$gClient = new Google_Client();\n $gClient->setApplicationName('Login');\n $gClient->setClientId(option('clientId'));\n $gClient->setClientSecret(option('clientSecret'));\n $gClient->setRedirectUri(option('redirectURL')); \n\t//\t$gClient->setHd(option('hd')); \n $google_oauthV2 = new Google_Oauth2Service($gClient);\n $authUrl = $gClient->createAuthUrl();\n return $authUrl;\n}", "public function getAuthAsString();", "public function getURL()\n {\n return Config::get('URL') . 'auth/unl/';\n }" ]
[ "0.73218894", "0.7157372", "0.6832804", "0.67731714", "0.64764035", "0.6465385", "0.64473003", "0.62885475", "0.6278464", "0.62723607", "0.6253919", "0.6215553", "0.617608", "0.617608", "0.6171891", "0.61702204", "0.6094732", "0.6073644", "0.60662067", "0.6051898", "0.6014222", "0.60117775", "0.59924567", "0.59795237", "0.59795237", "0.59658504", "0.593165", "0.5868144", "0.5852302", "0.58340997" ]
0.85969174
0
Get a middleware from the iterator
protected function getMiddleware() { $ret = null; if ($this->middleware->valid()) { $ret = $this->middleware->current(); $this->middleware->next(); } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMiddleware();", "protected function callback()\n {\n return GuzzleMiddleware::mapRequest(function (RequestInterface $request) {\n return $request->withHeader('T-middleware', $request->getHeaderLine('T-middleware') . 'B');\n });\n }", "public function get(): Middleware;", "public function getMiddleware()\n {\n return $this->middleware;\n }", "public function getMiddleware()\n {\n return $this->middleware;\n }", "private function getMiddleware()\n {\n if (isset($this->middlewareLayers[$this->middlewareIndex])) {\n return $this->middlewareLayers[$this->middlewareIndex];\n }\n\n return null;\n }", "public function shift()\n {\n return array_shift($this->middlewares);\n }", "public function getMiddleware() : LinkedList {\n return $this->assignedMiddlewareList;\n }", "protected function mockNextMiddleware()\n {\n return function ($request, $response) {\n return $response;\n };\n }", "public function middlewareNameCollection(): MiddlewaresInterface;", "public function getMiddlewares();", "public function popMiddleware()\n {\n return array_shift($this->middlewares);\n }", "public function getMiddleware($name)\n\t{\n\t\tif (array_key_exists($name, $this->middlewares))\n\t\t{\n\t\t\treturn $this->middlewares[$name];\n\t\t}\n\t}", "public function getAuthMiddleware(): callable{\n if($this->hasAuthMiddleware())\n return $this->_authorisationMiddleware;\n else\n return function(){ return true; };\n }", "public function next()\n {\n if (($middleware = next($this->middlewares))) {\n call_user_func($middleware, $this->request, $this->response, $this);\n } elseif ($this->parent !== null) {\n $this->parent->next();\n }\n }", "public function middleware($middleware, int $position = self::BOTH): self\n {\n return $this->filter($middleware, $position);\n }", "private function runMiddlewares()\n {\n $middleware = $this->getMiddleware();\n $this->middlewareIndex++;\n if (null === $middleware) {\n $this->runRoute();\n } else {\n return $middleware([$this, 'run']);\n }\n }", "public function middleware($middlewareDefinition): self;", "public function handle($request, Closure $next)\n {\n $result = Manager::middleware();\n return $result?$result:$next($request);\n }", "public function getThrowableHandler(): MiddlewareInterface;", "public function parse() : Middleware\n {\n $middlewareKey = $this->extractMiddlewareKey();\n $event = $this->extractEvent();\n $parameters = $this->extractParameters();\n\n $middleware = new Middleware($middlewareKey);\n if ($event) {\n $middleware->event($event);\n }\n if ($parameters) {\n $middleware->parameters($parameters);\n }\n\n return $middleware;\n }", "public function getExceptionHandler(): MiddlewareInterface;", "public function getMiddlewares() {\n\t\treturn $this->middlewares;\n\t}", "protected function step(): ResponseInterface {\n\t\t$current = $this->getMiddleware();\n\n\t\tif ($current !== null) {\n\t\t\t$delegate = $this->createDelegate(\n\t\t\t\tfunction(ServerRequestInterface $request) {\n\t\t\t\t\treturn $this->setRequest($request)->step();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$request = $this->getRequest();\n\n\t\t\treturn $current->process($request, $delegate);\n\t\t}\n\n\t\tthrow new Exception\\OutOfMiddlewareException(\n\t\t\t\"Middleware iterator exhausted.\"\n\t\t);\n\t}", "private static function middleware()\n {\n $files = ['Filters', 'Middleware'];\n $folder = static::$root.'Http/Middleware'.'/';\n\n self::call($files, $folder);\n\n $files = ['MiddlewareNotFoundException', 'MiddlewareWallException'];\n $folder = static::$root.'Http/Middleware/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "protected static function middleware()\n {\n foreach (self::fetch('http/middleware') as $file) {\n Bus::need($file);\n }\n\n Middleware::ini();\n }", "private function getMiddleware(CollectionAbstract $fieldItem): array {\r\n\r\n $middleware = $fieldItem -> getMiddleware();\r\n\r\n if(null !== $middleware) {\r\n\r\n if(count($middleware) > 0) {\r\n return $middleware;\r\n }\r\n\r\n return $this -> middleware;\r\n }\r\n\r\n return [];\r\n }", "public function middlewares()\n {\n }", "public function sampleMiddleware($request, $response, $next)\n {\n return $response;\n }", "protected function getMiddleware(EndpointCollection $endpoints): array\n {\n return $this->extractFromEndpoints($endpoints, 'middleware');\n }" ]
[ "0.6752117", "0.66690207", "0.6622647", "0.65207684", "0.65207684", "0.63957626", "0.63761896", "0.6352436", "0.62916", "0.62613744", "0.615779", "0.61190957", "0.60768324", "0.5982674", "0.59793043", "0.59714884", "0.5905679", "0.5836984", "0.58001155", "0.57484573", "0.56683236", "0.5661904", "0.56503856", "0.5627947", "0.56013876", "0.5590276", "0.5547651", "0.5534208", "0.5517323", "0.5480123" ]
0.70806575
0
Start the middleware pipeline If a delegate is given, will pass on the possibly modified request object when the iterator is no longer valid.
protected function run( ServerRequestInterface $request, DelegateInterface $delegate = null, Dispatcher $that = null ): ResponseInterface { $that = $that ?: clone $this; $that->setRequest($request); try { $response = $that->step(); } catch (Exception\OutOfMiddlewareException $ex) { if ($delegate === null) { throw $ex; } $response = $delegate->process( $that->getRequest() ); } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function next()\n {\n if (($middleware = next($this->middlewares))) {\n call_user_func($middleware, $this->request, $this->response, $this);\n } elseif ($this->parent !== null) {\n $this->parent->next();\n }\n }", "public function process(ServerRequestInterface $request, DelegateInterface $delegate)\n {\n if ($this->bootstrap) {\n $bootstrap = (microtime(true) - $this->start) * 1000;\n $this->stopwatch->set($this->bootstrap, $bootstrap);\n }\n\n /* Call all the other middlewares. */\n if ($this->process) {\n $this->stopwatch->start($this->process);\n $response = $delegate->process($request);\n $this->stopwatch->stop($this->process);\n }\n\n /* Time spent from starting the request to exiting last middleware. */\n if ($this->total) {\n $total = (microtime(true) - $this->start) * 1000;\n $this->stopwatch->set($this->total, (integer) $total);\n }\n $this->stopwatch->stopAll();\n\n return $response->withHeader(\n \"Server-Timing\",\n $this->generateHeader($this->stopwatch->values())\n );\n }", "public function run()\n {\n foreach ($this->middleware as $middleware) {\n $middleware = $this->bootstrapMiddleware($middleware);\n\n if (method_exists($middleware, 'handle')) {\n $middleware->handle($this->request, function (Request $request) {\n $this->request = $request;\n });\n }\n }\n\n return $this->request;\n }", "public function __invoke(\n RequestInterface $request,\n ResponseInterface $response,\n DelegateInterface $next = null\n )/*# : ResponseInterface */ {\n return $this->process($request, $response, $next);\n }", "protected function step(): ResponseInterface {\n\t\t$current = $this->getMiddleware();\n\n\t\tif ($current !== null) {\n\t\t\t$delegate = $this->createDelegate(\n\t\t\t\tfunction(ServerRequestInterface $request) {\n\t\t\t\t\treturn $this->setRequest($request)->step();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$request = $this->getRequest();\n\n\t\t\treturn $current->process($request, $delegate);\n\t\t}\n\n\t\tthrow new Exception\\OutOfMiddlewareException(\n\t\t\t\"Middleware iterator exhausted.\"\n\t\t);\n\t}", "public function next()\n {\n next($this->requests);\n }", "public function process(HTTPRequest $request, callable $delegate)\n {\n /** @var HTTPResponse $response */\n $response = $delegate($request);\n\n // Ignore by regexes.\n if ($this->shouldCheckHttpHost() && $this->isIgnoredDomain($_SERVER['HTTP_HOST'])) {\n return $response;\n }\n\n foreach ($this->requestedPolicies as $requestedPolicy) {\n /** @var ControllerPolicy $policyInstance */\n $policyInstance = $requestedPolicy['policy'];\n\n $policyInstance->applyToResponse(\n $requestedPolicy['originator'],\n $request,\n $response\n );\n }\n\n return $response;\n }", "public function __invoke($request)\n {\n $next = $this->middleware->get($this->index);\n\n if ($next)\n {\n $name = ($next['n']) ?? '';\n $mParams = explode(',',($next['p']) ?? '');\n\n // check if the middleware class actually exist,\n // otherwise we will need to close out this.\n if (!class_exists($name)) return false;\n\n // increment the middelware we instantiate\n $this->index++;\n\n // begin our middleware instance\n $middleware = new $name();\n\n // load our middelware handle instance for the request\n if (method_exists($middleware, 'handle'))\n {\n $this->middlewareInstances[] = $middleware;\n\n return $middleware->handle($request, $this, ...$mParams);\n }\n else\n {\n // if the middleware does not have a handle, we will need to end the script.\n // All middlewares must have a handle.\n return false;\n }\n }\n\n // return the updated response\n return $this->response;\n }", "public function process(ServerRequestInterface $request, DelegateInterface $delegate): ResponseInterface {\n $path = $request->getUri()->getPath();\n if (strpos($path, $this->prefix) === 0) {\n return $this->container->get($this->middleware)->process($request, $delegate);\n }\n return $delegate->process($request);\n }", "public function handle($request, Closure $next)\n {\n parent::filter();\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n parent::filter();\n\n return $next($request);\n }", "public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next);", "abstract public function apply(Request $request, Response $response, Closure $next);", "function __invoke(Request $request, Response $response, callable $next)\n {\n if (isset($_SESSION['errors'])) {\n $this->view->getEnvironment()->addGlobal('errors', $_SESSION['errors']);\n unset($_SESSION['errors']);\n }\n\n // Next Middleware\n $response = $next($request, $response);\n return $response;\n }", "abstract function __invoke(RequestInterface $request, ResponseInterface $response, callable $next);", "public function call()\n {\n // Get the reference to the application\n $app = $this->app;\n\n // Get the application request without trailing slashes \n $requesturi = ltrim($app->request->getPathInfo(), '/');\n\n if($requesturi != 'unauthorized') {\n // Check if the user is authorized to execute this request\n if(!Security::isUserAuthorized($requesturi)) {\n $app->redirect('/unauthorized');\n }\n }\n\n // Run the inner middleware and application\n $this->next->call();\n }", "public function before(callable $delegate) {\n\t\t\t$this->before = $delegate;\n\t\t\treturn $this;\n\t\t}", "public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface\n\t{\n\t\tif ($this->isWhitelisted($request)) {\n\t\t\treturn $next($request, $response);\n\t\t}\n\n\t\t$user = $this->authenticator->authenticate($request);\n\n\t\t// If we have a identity, then go to next middlewares,\n\t\t// otherwise stop and return current response\n\t\tif ($user === null) {\n\t\t\treturn $this->denied($request, $response);\n\t\t}\n\n\t\t// Add info about current logged user to request attributes\n\t\t$request = $request->withAttribute(RequestAttributes::APP_LOGGED_USER, $user);\n\n\t\t// Pass to next middleware\n\t\treturn $next($request, $response);\n\t}", "public function run()\n\t{\n\t\t$response = $this->dispatch($this['request']);\n\n\t\t$response->send();\n\n\t\t$this->callFinishMiddleware($response);\n\t}", "public function handle($request, Closure $next)\n {\n $this->start_execution = microtime(true);\n return $next($request);\n }", "public function start()\n {\n foreach ($this->routes as $route) {\n if ($route->match()) {\n $this->applyRoute($route); \n }\n\n if (!$route->continue) {\n break;\n }\n }\n }", "public function next()\n {\n next($this->_filters);\n if (($closure = current($this->_filters)) === false) {\n return false;\n }\n $params = $this->_params = func_get_args() + $this->_params;\n array_unshift($params, $this);\n return call_user_func_array($closure, $params);\n }", "private function runMiddlewares()\n {\n $middleware = $this->getMiddleware();\n $this->middlewareIndex++;\n if (null === $middleware) {\n $this->runRoute();\n } else {\n return $middleware([$this, 'run']);\n }\n }", "public function handle($request, Closure $next)\n {\n Log::info(\n 'Beginning request',\n [\n 'time' => microtime(true),\n 'method' => $request->method(),\n 'uri' => $request->url()\n ]\n );\n\n return $next($request);\n }", "private static function middleware()\n {\n $files = ['Filters', 'Middleware'];\n $folder = static::$root.'Http/Middleware'.'/';\n\n self::call($files, $folder);\n\n $files = ['MiddlewareNotFoundException', 'MiddlewareWallException'];\n $folder = static::$root.'Http/Middleware/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function handle($request, Closure $next)\n {\n $this->request = $request;\n\n info(\"================== FeMiddleware: [\".$request->path().\"] ====================\");\n $this->process($this->request);\n info(\"================== End============================================\");\n \n return $next($this->request);\n }", "public function process(ServerRequestInterface $request, RequestHandlerInterface $delegate)\n {\n if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::'\n . __LINE__ . ' processing...');\n\n $dispatcher = $this->_getDispatcher();\n\n $uri = $request->getUri()->getPath();\n\n // remove trailing slashes - FastRoute is not handling uris with them correctly it seems\n $uri = preg_replace('/\\/+$/', '', $uri);\n\n // if the tine20 server is located in a subdir, we need to remove the server path from the uri\n $serverPath = Tinebase_Core::getUrl('path');\n $uri = preg_replace('/^' . preg_quote($serverPath, '/') . '/', '', $uri);\n\n if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::'\n . __LINE__ . ' FastRoute dispatching on method: ' . $request->getMethod() . ' and uri: '\n . $uri);\n\n $routeInfo = $dispatcher->dispatch($request->getMethod(), $uri);\n switch ($routeInfo[0]) {\n case FastRoute\\Dispatcher::NOT_FOUND:\n if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::'\n . __LINE__ . ' returning 404 not found');\n\n // 404 not found\n return new Response('php://memory', 404);\n case FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::'\n . __LINE__ . ' returning 405 method not allowed');\n\n //$allowedMethods = $routeInfo[1];\n // 405 method not allowed\n return new Response('php://memory', 405);\n case FastRoute\\Dispatcher::FOUND:\n if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::'\n . __LINE__ . ' FastRoute dispatching result: ' . print_r($routeInfo, true));\n\n $handler = Tinebase_Expressive_RouteHandler::fromArray($routeInfo[1]);\n $handler->setVars($routeInfo[2]);\n return $delegate->handle($request->withAttribute(Tinebase_Expressive_Const::ROUTE_HANDLER, $handler));\n break;\n default:\n throw new Tinebase_Exception_UnexpectedValue('fast route dispatcher returned unexpected route info');\n }\n\n // in case you ever want to call $delegate->process without add the Tinebase_Expressive_Const::ROUTE_HANDLER\n // then do it like this: $delegate->process($request->withoutAttribute(Tinebase_Expressive_Const::ROUTE_HANDLER)\n }", "public function handle($request, Closure $next)\n {\n return parent::handle($request, $next); // defer to the right stuff\n }", "public function setUp()\n {\n $this->middleware = new ForbiddenWordsFilterMiddleware(['badword']);\n $this->request = Phake::mock(ServerRequestInterface::class);\n $this->delegate = Phake::mock(DelegateInterface::class);\n\n // the class needs to know which route it matched. Create a fake result and tell the request to return that\n $this->route_result = Phake::mock(RouteResult::class);\n Phake::when($this->request)->getAttribute(RouteResult::class)->thenReturn($this->route_result);\n Phake::when($this->route_result)->getMatchedParams()->thenReturn([]);\n\n // return an empty body stream\n Phake::when($this->request)->getBody()->thenReturn(new BufferStream());\n\n // when try try to replace the body just return the same request as before.\n Phake::when($this->request)->withBody($this->anything())->thenReturn($this->request);\n }", "public function handle(Builder $builder, Closure $next)\n {\n if (!$this->request->has($this->filterName()) || $this->request->input($this->filterName(), '') === '') {\n return $next($builder);\n }\n return $this->applyFilters($next($builder));\n }" ]
[ "0.5794255", "0.5558549", "0.550864", "0.54824185", "0.5475669", "0.545505", "0.54468197", "0.5331015", "0.52557105", "0.5231224", "0.5231224", "0.5162262", "0.51076806", "0.5057811", "0.50243485", "0.49876884", "0.49771276", "0.49744737", "0.49687684", "0.495803", "0.49214035", "0.48839045", "0.4867241", "0.48664066", "0.4858104", "0.48579293", "0.4810056", "0.48058653", "0.47977063", "0.47962677" ]
0.5926326
0
Set the current ServerRequestInterface object
protected function setRequest(ServerRequestInterface $request) { $this->request = $request; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRequest(ServerRequestInterface $request);", "public function setRequest(RequestInterface $request);", "public static function setRequest(RequestInterface $request)\n {\n $coroutineId = self::getCoroutineId();\n self::$context[$coroutineId][self::REQUEST_KEY] = $request;\n }", "public function setRequest(RequestInterface $request)\n {\n $this->request = $request;\n }", "public static function setRequestContext(ServerRequestInterface $request)\n {\n $uri = $request->getUri();\n static::$_requestContext = [\n '_base' => $request->getAttribute('base'),\n '_port' => $uri->getPort(),\n '_scheme' => $uri->getScheme(),\n '_host' => $uri->getHost(),\n ];\n }", "public function __invoke(\n ServerRequestInterface $request\n );", "protected function setRequest(RequestInterface $request): ResponseHandler\n {\n $this->request = $request;\n\n return $this;\n }", "public function __construct(PsrServerRequestInterface $request)\n {\n $this->request = $request;\n }", "function setRequest($request) {\n\t\t$this->m_request = $request;\n\t}", "function setRequest($value) {\n $this->request = $value;\n }", "public function process(ServerRequestInterface $request)\n {\n }", "public function setRequest($request);", "public function request() : ServerRequestInterface;", "public function setRequestEngine(RequestEngineInterface $requestEngine) {\n\t\t$this->requestEngine = $requestEngine;\n\t}", "function setRequest($request) {\n $this->request = $request;\n }", "public function forRequest(ServerRequestInterface $request): self\n {\n if ($request->getMethod() !== 'POST') {\n return $this;\n }\n\n $requestData = json_decode($request->getBody()->read(8192), true);\n if (empty($requestData)) {\n return $this;\n }\n\n $this->setSearchTerm($requestData['term']['label']);\n $this->setOriginalSearchValue($requestData['term']['search']);\n $this->setExcludeTerms($requestData['exclude'] ?? []);\n\n return $this;\n }", "public function __invoke(\n ServerRequestInterface $request,\n ResponseInterface $response\n );", "public function createServerRequestFromGlobals(): ServerRequestInterface;", "public function createServerRequestFromGlobals(): ServerRequestInterface;", "public function setResponse(ResponseInterface $request);", "public function setRequest(RequestInterface $request): ControllerInterface;", "public static function setRequestInfo($request)\n {\n if ($request instanceof ServerRequest) {\n static::pushRequest($request);\n } else {\n $requestData = $request;\n $requestData += [[], []];\n $requestData[0] += [\n 'controller' => false,\n 'action' => false,\n 'plugin' => null\n ];\n $request = new ServerRequest();\n $request->addParams($requestData[0])->addPaths($requestData[1]);\n static::pushRequest($request);\n }\n }", "public function prepareRequest(RequestInterface $request);", "private function setRequest() {\n // Create request object\n $this->request = Request::createFromGlobals();\n // Check caching and exit if so\n // - create a dummy response for possible 304\n $response = new Response();\n $seconds = Config::get()->pagecachetime;\n $response->setLastModified(new DateTime('-' . $seconds . ' seconds'));\n if ($response->isNotModified($this->getRequest())) {\n $response\n ->setSharedMaxAge($seconds)\n ->send();\n exit();\n }\n // Add better json request support\n // check request Content-Type\n $ctCheck = 0 === strpos(\n $this->request->headers->get('CONTENT_TYPE')\n , 'application/json'\n );\n // check request Method\n $methodCheck = in_array(\n strtoupper($this->request->server->get('REQUEST_METHOD', 'GET'))\n , array('PUT', 'DELETE', 'POST')\n );\n if ($ctCheck && $methodCheck) {\n $params = (array) json_decode($this->request->getContent());\n $this->request->request = new ParameterBag($params);\n }\n }", "public function __construct(ServerRequestInterface $serverRequest)\n {\n $userAgent = '';\n $serverParams = $serverRequest->getServerParams();\n\n if (isset($serverParams['REMOTE_ADDR'])) {\n $userAgent = $serverParams['REMOTE_ADDR'];\n }\n\n $this->userAgent = $userAgent;\n }", "public function setData(ServerRequestInterface $request) : void\n\t{\n\t\t$this->baseController->setBaseVariables($request);\n\n\t\t$month = $request->getAttribute('month');\n\t\t$formatIdentifier = $request->getAttribute('formatIdentifier');\n\t\t$rating = (int) $request->getAttribute('rating');\n\t\t$languageId = new LanguageId((int) $request->getAttribute('languageId'));\n\n\t\t$myFormat = $request->getCookieParams()[CookieNames::FORMAT] ?? '';\n\t\t$myRating = $request->getCookieParams()[CookieNames::RATING] ?? '';\n\n\t\t$this->statsUsageModel->setData(\n\t\t\t$month,\n\t\t\t$formatIdentifier,\n\t\t\t$rating,\n\t\t\t$myFormat,\n\t\t\t$myRating,\n\t\t\t$languageId\n\t\t);\n\t}", "public function setRequest(namespace\\Request $request)\n {\n $this->request = $request;\n }", "public function setRequest($request)\n {\n $this->request = $request;\n }", "public static function set_request($request){\n\t\t\tself::$request = $request;\n\t\t}", "public static function setAttribute(ServerRequestInterface $request, $name, $value)\n {\n $attributes = $request->getAttribute(self::KEY, []);\n $attributes[$name] = $value;\n\n return $request->withAttribute(self::KEY, $attributes);\n }" ]
[ "0.8789558", "0.78180313", "0.77397805", "0.76855034", "0.74649894", "0.7052358", "0.6970045", "0.68101746", "0.67305535", "0.66011596", "0.65865564", "0.6568458", "0.6544348", "0.64832836", "0.6470893", "0.64315104", "0.6385715", "0.63439685", "0.63439685", "0.6340564", "0.63030493", "0.6259971", "0.6251736", "0.6237574", "0.6230486", "0.6214483", "0.62110156", "0.6202675", "0.6112948", "0.610075" ]
0.82014227
1
Find a redirect code in the codes
function is_redirect_http_codes($http_codes) { foreach ($http_codes as $http_code) { if ( is_redirect_http_code($http_code) ) { return TRUE; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_url($url) {\r\n $http_codes = array();\r\n $urls = array();\r\n while (TRUE) {\r\n // Initialise curl and get the header\r\n $ch = curl_init($url);\r\n curl_setopt($ch, CURLOPT_HEADER, true);\r\n curl_setopt($ch, CURLOPT_NOBODY, true);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);\r\n curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\r\n $content = curl_exec($ch);\r\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n \r\n // Add urls and http codes to the arrays\r\n array_push($urls, $url);\r\n array_push($http_codes, $http_code);\r\n \r\n if ( is_redirect_http_code($http_code) ) {\r\n // Check for redirects, if found, follow the redirected URL\r\n if ( preg_match('/(?<=Location: )[^ \\s]*/i', $content, $matches) ) {\r\n $url = $matches[0];\r\n continue;\r\n }\r\n }\r\n \r\n // We can't do anything else\r\n break;\r\n }\r\n \r\n // Contains all the http_codes and urls encountered\r\n $ret['http_codes'] = $http_codes;\r\n $ret['urls'] = $urls;\r\n // For easy access, contains the last http_code and url encountered\r\n $ret['http_code'] = $http_code;\r\n $ret['url'] = $url;\r\n return $ret;\r\n}", "private function get_redirect( $line, $target, $code, $source ) {\n\t\t$line = ltrim( $line, '^' );\n\t\t$line = rtrim( $line, '$' );\n\n\t\tif ( isset( $source['flag_case'] ) && $source['flag_case'] ) {\n\t\t\t$line = '(?i)^' . $line;\n\t\t} else {\n\t\t\t$line = '^' . $line;\n\t\t}\n\n\t\t$line = preg_replace( \"/[\\r\\n\\t].*?$/s\", '', $line );\n\t\t$line = preg_replace( '/[^\\PC\\s]/u', '', $line );\n\t\t$target = preg_replace( \"/[\\r\\n\\t].*?$/s\", '', $target );\n\t\t$target = preg_replace( '/[^\\PC\\s]/u', '', $target );\n\n\t\treturn 'rewrite ' . $line . '$ ' . $target . ' ' . $code . ';';\n\t}", "function changeRedirectorUrlTag(&$codes = [])\n{\n foreach ($codes as $codeId => $code) {\n if ($code['tag'] == 'url' && $code['type'] == 'unparsed_content') {\n $codes[$codeId]['validate'] = function (&$tag, &$data) {\n changeUrlUnparsedContentCode($tag, $data);\n };\n } elseif ($code['tag'] == 'url' && $code['type'] == 'unparsed_equals') {\n $codes[$codeId]['validate'] = function (&$tag, &$data) {\n changeUrlUnparsedEqualsCode($tag, $data);\n };\n } elseif ($code['tag'] == 'iurl' && $code['type'] == 'unparsed_content') {\n $codes[$codeId]['validate'] = function (&$tag, &$data) {\n changeUrlUnparsedContentCode($tag, $data);\n };\n } elseif ($code['tag'] == 'iurl' && $code['type'] == 'unparsed_equals') {\n $codes[$codeId]['validate'] = function (&$tag, &$data) {\n changeUrlUnparsedEqualsCode($tag, $data);\n };\n }\n }\n}", "private function get_redirect_source() {\n\t\t$ignore = [\n\t\t\t'WP_Hook',\n\t\t\t'template-loader.php',\n\t\t\t'wp-blog-header.php',\n\t\t];\n\n\t\t// phpcs:ignore\n\t\t$source = wp_debug_backtrace_summary( null, 5, false );\n\n\t\treturn array_filter( $source, function( $item ) use ( $ignore ) {\n\t\t\tforeach ( $ignore as $ignore_item ) {\n\t\t\t\tif ( strpos( $item, $ignore_item ) !== false ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}", "public static function checkCode($code)\n {\n return static::where('short_url', $code)\n ->first();\n }", "private static function pay($code, $redirect)\n {\n $url = URL::getUrl('Pay');\n\n $location = \"{$url}{$code}\";\n\n /** */\n if ($redirect)\n {\n return redirect()->away($location);\n }\n\n return $location;\n }", "protected function getAccessCode()\n {\n return $_GET[self::RESPONSE_CODE_PARAM];\n }", "public function GetRedirect ();", "private function getIdFromRedirectedUrl(): string\n {\n $url = $this->getResponse()\n ->getHeader('Location')\n ->getFieldValue();\n $pattern = '!/id/(.*?)/!';\n $result = preg_match($pattern, $url, $matches);\n\n return $result ? $matches[1] : '';\n }", "abstract protected function get_redirect_page();", "function getHttpResponseCode_using_getheaders($url, $followredirects = true){\n // NOTE: could potentially take up to 0-30 seconds , blocking further code execution (more or less depending on connection, target site, and local timeout settings))\n // if $followredirects == false: return the FIRST known httpcode (ignore redirects)\n // if $followredirects == true : return the LAST known httpcode (when redirected)\n if(! $url || ! is_string($url)){\n return false;\n }\n $headers = @get_headers($url);\n if($headers && is_array($headers)){\n if($followredirects){\n // we want the the last errorcode, reverse array so we start at the end:\n $headers = array_reverse($headers);\n }\n foreach($headers as $hline){\n // search for things like \"HTTP/1.1 200 OK\" , \"HTTP/1.0 200 OK\" , \"HTTP/1.1 301 PERMANENTLY MOVED\" , \"HTTP/1.1 400 Not Found\" , etc.\n // note that the exact syntax/version/output differs, so there is some string magic involved here\n if(preg_match('/^HTTP\\/\\S+\\s+([1-9][0-9][0-9])\\s+.*/', $hline, $matches) ){// \"HTTP/*** ### ***\"\n $code = $matches[1];\n return $code;\n }\n }\n // no HTTP/xxx found in headers:\n return false;\n }\n // no headers :\n return false;\n }", "public function GetCode()\n {\n if($this->_correctHttpLine != null)\n {\n preg_match(\"|^HTTP/[\\d\\.x]+ (\\d+)|\", $this->_correctHttpLine, $m);\n if (isset($m[1])) { return (int)$m[1]; }\n }\n\n return false;\n }", "protected function getMethodRedirectUrl($code)\n {\n return $this->_methods[$code]->getCheckoutRedirectUrl();\n }", "public function getCode()\n {\n $this->code = $_GET['code'];\n return $this->code;\n\n }", "function detect_link(&$comcode,$pos)\n{\n\t$link_end_pos=strpos($comcode,' ',$pos-1);\n\t$link_end_pos_2=strpos($comcode,chr(10),$pos-1);\n\t$link_end_pos_3=strpos($comcode,'[',$pos-1);\n\t$link_end_pos_4=strpos($comcode,')',$pos-1);\n\t$link_end_pos_5=strpos($comcode,'\"',$pos-1);\n\t$link_end_pos_6=strpos($comcode,'>',$pos-1);\n\t$link_end_pos_7=strpos($comcode,'<',$pos-1);\n\t$link_end_pos_8=strpos($comcode,'.'.chr(10),$pos-1);\n\t$link_end_pos_9=strpos($comcode,',',$pos-1);\n\tif (($link_end_pos_2!==false) && (($link_end_pos===false) || ($link_end_pos_2<$link_end_pos))) $link_end_pos=$link_end_pos_2;\n\tif (($link_end_pos_3!==false) && (($link_end_pos===false) || ($link_end_pos_3<$link_end_pos))) $link_end_pos=$link_end_pos_3;\n\tif (($link_end_pos_4!==false) && (($link_end_pos===false) || ($link_end_pos_4<$link_end_pos))) $link_end_pos=$link_end_pos_4;\n\tif (($link_end_pos_5!==false) && (($link_end_pos===false) || ($link_end_pos_5<$link_end_pos))) $link_end_pos=$link_end_pos_5;\n\tif (($link_end_pos_6!==false) && (($link_end_pos===false) || ($link_end_pos_6<$link_end_pos))) $link_end_pos=$link_end_pos_6;\n\tif (($link_end_pos_7!==false) && (($link_end_pos===false) || ($link_end_pos_7<$link_end_pos))) $link_end_pos=$link_end_pos_7;\n\tif (($link_end_pos_8!==false) && (($link_end_pos===false) || ($link_end_pos_8<$link_end_pos))) $link_end_pos=$link_end_pos_8;\n\tif (($link_end_pos_9!==false) && (($link_end_pos===false) || ($link_end_pos_9<$link_end_pos))) $link_end_pos=$link_end_pos_9;\n\tif ($link_end_pos===false) $link_end_pos=strlen($comcode);\n\t$auto_link=preg_replace('#keep_session=\\d*#','filtered=1',substr($comcode,$pos-1,$link_end_pos-$pos+1));\n\n\treturn array($link_end_pos,$auto_link);\n}", "public static function getDrupalGotoCode() {\n global $drupal_goto;\n return !empty($drupal_goto['http_response_code']) ?\n $drupal_goto['http_response_code'] : '';\n }", "public static function getOriginalUrl($code)\n {\n $url = static::checkCode($code);\n if (!empty($url)) {\n $url->hits++;\n $url->save();\n\n return $url->original_url;\n }\n\n return false;\n }", "public function getPermanentRedirectStatuscode(): MwRedirectResponseStatuscode\n {\n return $this->findStatuscodeBy(['type' => self::REDIRECT_STATUSCODE_301]);\n }", "protected function _extractHttpCode($header) {\n\t\tpreg_match(\n\t\t\t'#^HTTP/[0-9\\.]+\\s(?P<code>[0-9]+)#i',\n\t\t\t$header,\n\t\t\t$matches\n\t\t);\n\n\t\treturn isset($matches['code'])\n\t\t\t? $matches['code']\n\t\t\t: $this->_defaultCode;\n\t}", "public function customRedirect($param, $redirectcode) {\n\t$redirect = $this->trimSlash(Mage::getUrl($param));\n if($redirectcode == 0 || $redirectcode == 'default' || $redirectcode == 302 ){\n\t\tMage::app()->getFrontController()->getResponse()->setRedirect($redirect, 302);\n\t\t} else { \n\t\tMage::app()->getFrontController()->getResponse()->setRedirect($redirect, 301);\n\t\t} \n Mage::app()->getResponse()->sendResponse();\n exit;\n }", "function get_oauth_code($wpoa) {\n\t$params = array(\n\t\t'response_type' => 'code',\n\t\t'client_id' => CLIENT_ID,\n\t\t'scope' => SCOPE,\n\t\t'state' => uniqid('', true),\n\t\t'redirect_uri' => REDIRECT_URI,\n\t);\n\t$_SESSION['WPOA']['STATE'] = $params['state'];\n\t$url = URL_AUTH . http_build_query($params);\n\theader(\"Location: $url\");\n\texit;\n}", "protected function checkRedirect() {}", "public function isRedirect(): bool\n {\n return $this->code >= 300 && $this->code < 400;\n }", "public function getRedirect(): ?string\n {\n if ($this->getText() && preg_match('/^#REDIRECT(?:ION)? ?\\[\\[([^]]+)]]/i', $this->getText(), $matches)) {\n return (string)trim($matches[1]);\n }\n\n return null;\n }", "private function hasReferralCode()\n {\n if (self::isLogin()) {\n $model = $this->model->where('user_id', Auth::id());\n\n if ($model->count() > 0) {\n $this->code = $model->first()->code;\n return true;\n }\n }\n\n return false;\n }", "function is_redirect ($sc) { \n return $sc >= 300 && $sc < 400; \n}", "public function getCode()\n\t{\n\t\t$matches = array();\n\t\tif (isset($this->headers) && isset($this->headers[0]))\n\t\t\tpreg_match('|HTTP/\\d\\.\\d\\s+(\\d+)\\s+.*|', $this->headers[0], $matches);\n\t\treturn isset($matches[1]) ? (int)$matches[1] : 0;\n\t}", "function redirected(){ return strlen((string)$this->getLocation())>0; }", "public function checkFavebookInsightsCode($code) {\r\n if ($code <> '') {\r\n if (strpos($code, 'content') !== false) {\r\n preg_match('/content\\\\s*=\\\\s*[\\'\\\"]([^\\'\\\"]+)[\\'\\\"]/i', $code, $result);\r\n $code = '';\r\n if (isset($result[1]) && !empty($result[1])) {\r\n $code = $result[1];\r\n }\r\n }\r\n\r\n if (strpos($code, 'facebook.com/') !== false) {\r\n preg_match('/facebook.com\\/([^\\/]+)/i', $code, $result);\r\n $code = '';\r\n if (isset($result[1]) && !empty($result[1])) {\r\n $json = SQ_Tools::sq_remote_get('http://graph.facebook.com/' . $result[1]);\r\n if ($json <> '') {\r\n if ($json = @json_decode($json)) {\r\n if (isset($json->id)) {\r\n $code = $json->id;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (strpos($code, '\"') !== false) {\r\n preg_match('/[\\'\\\"]([^\\'\\\"]+)[\\'\\\"]/i', $code, $result);\r\n $code = '';\r\n if (isset($result[1]) && !empty($result[1])) {\r\n $code = $result[1];\r\n }\r\n }\r\n\r\n if ($code == '') {\r\n SQ_Error::setError(__(\"The code for Facebook is incorrect.\", _SQ_PLUGIN_NAME_));\r\n }\r\n }\r\n return $code;\r\n }", "protected function processRedirect() {}" ]
[ "0.5923443", "0.5621442", "0.55835414", "0.55640584", "0.54911375", "0.5490793", "0.5484887", "0.54746276", "0.5465752", "0.54568994", "0.54501665", "0.54036313", "0.5374671", "0.53691274", "0.5354483", "0.53535295", "0.5334649", "0.5333545", "0.52064425", "0.5204692", "0.5199307", "0.5179773", "0.51458484", "0.51305836", "0.51275104", "0.5114682", "0.5111576", "0.5109506", "0.5103006", "0.50689906" ]
0.62229073
0
Array of urls and http codes
function check_url($url) { $http_codes = array(); $urls = array(); while (TRUE) { // Initialise curl and get the header $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); $content = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); // Add urls and http codes to the arrays array_push($urls, $url); array_push($http_codes, $http_code); if ( is_redirect_http_code($http_code) ) { // Check for redirects, if found, follow the redirected URL if ( preg_match('/(?<=Location: )[^ \s]*/i', $content, $matches) ) { $url = $matches[0]; continue; } } // We can't do anything else break; } // Contains all the http_codes and urls encountered $ret['http_codes'] = $http_codes; $ret['urls'] = $urls; // For easy access, contains the last http_code and url encountered $ret['http_code'] = $http_code; $ret['url'] = $url; return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUrls(): array;", "public function getUrls(): array;", "function urls($data)\r\n{\r\n $result = array();\r\n if (is_array($data)) {\r\n if (isset($data['href']))\r\n $result[] = $data['href']; else\r\n foreach ($data as $d)\r\n if (is_array($d))\r\n $result[] = $d['href']; else\r\n $result[] = $d;\r\n } else $result[] = $data;\r\n\r\n // Make URLs full\r\n $result2 = array();\r\n global $last_url, $last_base;\r\n $last_domain = substr($last_url, 0, strpos($last_url, '/', 10));\r\n if ($p = strpos($last_url,'?'))\r\n $last_php = substr($last_url,0,$p);\r\n else $last_php = $last_url;\r\n\r\n foreach ($result as $url) {\r\n $url = trim($url);\r\n if (!$url)\r\n continue;\r\n $url = str_replace('./','',$url);\r\n if (substr($url,0,2)=='//') $url = 'http:'.$url;\r\n if (strpos($url, '://') === false)\r\n if ($url[0] == '/')\r\n $url = $last_domain . $url;\r\n elseif ($url[0] == '?') $url = $last_php . $url;\r\n else $url = $last_base . $url;\r\n // Check for right donor\r\n //if (strpos(domain($url),$GLOBALS['instruction']['host'])===false) continue;\r\n $result2[] = $url;\r\n }\r\n $r = $result2;\r\n\r\n if (DEV)\r\n xlogc('urls', $r, $data);\r\n\r\n return $r;\r\n}", "public function getWebsiteCodes()\n {\n return $this->websiteCodes;\n }", "public function httpCodes($code = null) {\n\t\tif (empty($code)) {\n\t\t\treturn $this->_statusCodes;\n\t\t}\n\t\tif (is_array($code)) {\n\t\t\t$codes = array_keys($code);\n\t\t\t$min = min($codes);\n\t\t\tif (!is_int($min) || $min < 100 || max($codes) > 999) {\n\t\t\t\tthrow new CakeException(__d('cake_dev', 'Invalid status code'));\n\t\t\t}\n\t\t\t$this->_statusCodes = $code + $this->_statusCodes;\n\t\t\treturn true;\n\t\t}\n\t\tif (!isset($this->_statusCodes[$code])) {\n\t\t\treturn null;\n\t\t}\n\t\treturn array($code => $this->_statusCodes[$code]);\n\t}", "static public function getCodes(){\n return array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Moved Temporarily',\n 307 => 'Temporary Redirect',\n 310 => 'Too many Redirects',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Time-out',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested range unsatisfiable',\n 417 => 'Expectation failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Time-out',\n 508 => 'Loop detected',\n );\n }", "private function codes()\n {\n $a_http_status_codes = array(\n 100 => 'Continue', 102 => 'Processing',\n 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content',\n 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported',\n 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other',\n 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect',\n 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found',\n 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout',\n 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 421 => 'Misdirected Request',\n 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 426 => 'Upgrade Required',\n 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large',\n 451 => 'Unavailable For Legal Reasons', 500 => 'Internal Server Error', 501 => 'Not Implemented',\n 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected',\n 510 => 'Not Extended', 511 => 'Network Authentication Required'\n );\n return $a_http_status_codes;\n }", "function getHttpCode();", "public function getUrls()\r\n {\r\n }", "function is_redirect_http_codes($http_codes) {\r\n foreach ($http_codes as $http_code) {\r\n if ( is_redirect_http_code($http_code) ) {\r\n return TRUE;\r\n }\r\n }\r\n}", "public function httpStatusDataProvider()\n {\n return [\n [\"badGateway\", 502, \"Bad gateway\"],\n [\"badRequest\", 400, \"Bad request\"],\n [\"conflict\", 409, \"Conflict\"],\n [\"expectationFailed\", 417, \"Expectation failed\"],\n [\"forbidden\", 403, \"Forbidden\"],\n [\"gatewayTimeout\", 504, \"Gateway timeout\"],\n [\"gone\", 410, \"Gone\"],\n [\"httpVersionNotSupported\", 505, \"Http version not supported\"],\n [\"internalServerError\", 500, \"Internal server error\"],\n [\"lengthRequired\", 411, \"Length required\"],\n [\"methodNotAllowed\", 405, \"Method not allowed\"],\n [\"notAcceptable\", 406, \"Not acceptable\"],\n [\"notFound\", 404, \"Not found\"]\n // TODO: Add the remaining status codes.\n ];\n }", "function getList($urls){\n\t\t$urls = preg_split(\"[\\r\\n]\",$urls);\n\t\t$output = array();\n\t\t$counter = 0;\n\t\tforeach($urls as $url){\n\t\t\t$url = trim($url);\n\t\t\tif($url){\n\t\t\t\t$counter++;\n\t\t\t\t$output[$this->fixurl($url)] = $this->getPRInfo($url);\n\t\t\t}\n\t\t\tif($counter >= 10) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "function get_internal_links($array){\r\n $result = array();\r\n $count = count($array);\r\n for($i=0;$i<$count;$i++){\r\n if(!empty($array[$i])){ \r\n if(strpos($array[$i],\"www\",0) === false){\r\n if(strpos($array[$i],\"http\",0) === false){ \r\n array_push($result,$array[$i]);\r\n }\r\n }\r\n }\r\n }\r\n return $result;\r\n}", "public function getAll(): array\n {\n\n\t$url = new Url();\n\n return array_merge(\n apache_request_headers(),\n apache_response_headers(),\n get_headers($url->hostWithSchema($url->getHostIp()), 1)\n );\n\n }", "protected function getHttpResponseCodes() {\n return array (\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 102 => 'Processing',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 207 => 'Multi-Status',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => 'Switch Proxy',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 418 => 'I\\'m a teapot',\n 422 => 'Unprocessable Entity',\n 423 => 'Locked',\n 424 => 'Failed Dependency',\n 425 => 'Unordered Collection',\n 426 => 'Upgrade Required',\n 449 => 'Retry With',\n 450 => 'Blocked by Windows Parental Controls',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates',\n 507 => 'Insufficient Storage',\n 509 => 'Bandwidth Limit Exceeded',\n 510 => 'Not Extended'\n );\n }", "public function getUrls() {\n return $this->urls;\n }", "public function getRedirects();", "public function getPageUris();", "public function badUrlProvider() {\n\n $badRedirects[\"ip: 127.0.0.1\"] = array(\"http://127.0.0.1\", false);\n\n // Anything that resolves to zero needs to be tested carefully due to falsiness\n $badRedirects[\"ip: 0\"] = array(\"http://0/data.json\", false);\n\n // Hex is bad\n $badRedirects[\"ip: hex\"] = array(\"http://0x7f000001/data.json\", false);\n\n // So is octal\n $badRedirects[\"ip: octal\"] = array(\"http://0123/data.json\", false);\n\n // We don't like mixed hex and octal either\n $badRedirects[\"ip: mixed hex/octal/decimal\"] = array(\"http://0x7f.0x0.0.0/data.json\", false);\n\n // We don't even like dotted-quads\n $badRedirects[\"ip: dotted-quad\"] = array(\"http://111.22.34.56/data.json\", false);\n\n // Don't you come around here with any of that IPv6 crap\n $badRedirects[\"ipv6: localhost\"] = array(\"http://[::1]\", false);\n\n // Domains that resolve to IPv4 localhost? NFW.\n $badRedirects[\"localhost.ip4\"] = array(\"https://localhost.ip4/\", [['type' => 'A', 'ip' => '127.0.0.1']]);\n\n // Domains that resolve to IPv6 localhost? Get out!\n $badRedirects[\"localhost.ip6\"] = array(\"https://localhost.ip6:443\", [['type' => 'AAAA', 'ipv6' => '::1']]);\n\n // Domains that resolve to IPv6 addresses that represent IPv4 private ranges? Not on our watch!\n $badRedirects[\"localhost2.ip6\"] = array(\"http://localhost2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.1']]);\n $badRedirects[\"private1.ip6\"] = array(\"https://private1.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:192.168.1.18']]);\n $badRedirects[\"private2.ip6\"] = array(\"https://private2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:10.0.0.1']]);\n $badRedirects[\"private3.ip6\"] = array(\"http://private3.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.2']]);\n\n // Domains that resolve to IPv6 link-local adddresses? Hell no!\n $badRedirects[\"linklocal.ip6\"] = array(\"https://linklocal.ip6/\", [['type' => 'AAAA', 'ipv6' => 'fe80::']]);\n\n return $badRedirects;\n }", "public function requests() {\n return array(\n // Format:\n // array('expected', 'YOURLS_SITE', '/request_uri'),\n\n // 1. short URL without www\n array('blah', 'http://sho.rt', '/blah'),\n array('bleh', 'https://sho.rt', '/bleh'),\n array('bloh', 'http://www.sho.rt', '/bloh'),\n array('bluh', 'https://www.sho.rt', '/bluh'),\n\n // 2. short URL with www\n array('meeh', 'http://sho.rt', '/meeh'),\n array('maah', 'https://sho.rt', '/maah'),\n array('muuh', 'http://www.sho.rt', '/muuh'),\n array('mooh', 'https://www.sho.rt', '/mooh'),\n\n // 3. Same as 1, with YOURLS in subdir\n array('hehe', 'http://sho.rt/yourls', '/yourls/hehe'),\n array('haha', 'https://sho.rt/yourls', '/yourls/haha'),\n array('hoho', 'http://www.sho.rt/yourls', '/yourls/hoho'),\n array('huhu', 'https://www.sho.rt/yourls', '/yourls/huhu'),\n\n // 4. Same as 2, with YOURLS in subdir\n array('ozhy', 'http://sho.rt/yourls', '/yourls/ozhy'),\n array('yhzo', 'https://sho.rt/yourls', '/yourls/yhzo'),\n array('zohy', 'http://www.sho.rt/yourls', '/yourls/zohy'),\n array('zoyh', 'https://www.sho.rt/yourls', '/yourls/zoyh'),\n\n\n // All the same tests, with a trailing slash on YOURLS_SITE\n\n array('blah', 'http://sho.rt/', '/blah'),\n array('bleh', 'https://sho.rt/', '/bleh'),\n array('bloh', 'http://www.sho.rt/', '/bloh'),\n array('bluh', 'https://www.sho.rt/', '/bluh'),\n\n array('meeh', 'http://sho.rt/', '/meeh'),\n array('maah', 'https://sho.rt/', '/maah'),\n array('muuh', 'http://www.sho.rt/', '/muuh'),\n array('mooh', 'https://www.sho.rt/', '/mooh'),\n\n array('hehe', 'http://sho.rt/yourls/', '/yourls/hehe'),\n array('haha', 'https://sho.rt/yourls/', '/yourls/haha'),\n array('hoho', 'http://www.sho.rt/yourls/', '/yourls/hoho'),\n array('huhu', 'https://www.sho.rt/yourls/', '/yourls/huhu'),\n\n array('ozhy', 'http://sho.rt/yourls/', '/yourls/ozhy'),\n array('yhzo', 'https://sho.rt/yourls/', '/yourls/yhzo'),\n array('zohy', 'http://www.sho.rt/yourls/', '/yourls/zohy'),\n array('zoyh', 'https://www.sho.rt/yourls/', '/yourls/zoyh'),\n\n\n // For people having fun with MixEd case UrLs\n array('MiXeD', 'http://SHO.rt/', '/MiXeD'),\n array('CaSe', 'http://SHO.rt/Yourls/', '/Yourls/CaSe'),\n\n\n // Internal pages, sort of\n // Note that in a real case use, this won't happen since the client request won't trigger the .htaccess rewrite rules\n array('admin/index.php', 'https://www.sho.rt', '/admin/index.php'),\n array('admin/tools.php', 'http://www.sho.rt/yourls', '/yourls/admin/tools.php'),\n array('admin/plugins.php', 'https://sho.rt/yourls/', '/yourls/admin/plugins.php'),\n\n\n // Unexpected URI (out of YOURLS base) should return itself\n // Note that in a real case use, this won't happen since the client request won't trigger the .htaccess rewrite rules\n array('something.else/blah', 'http://sho.rt', '/something.else/blah'),\n array('something.else/blah', 'https://www.sho.rt', '/something.else/blah'),\n array('/oops', 'https://www.sho.rt/yourls', '/oops'),\n\n\n // Query strings which should be ignored\n array('behemoth', 'http://sho.rt', '/behemoth?sho.rt'),\n array('behemoth', 'http://sho.rt/behemoth', '/behemoth/behemoth?behemoth'),\n\n\n // \"Prefix and shorten\" scenarios (query strings which should be preserved)\n array('http://longurl', 'http://sho.rt', '/http://longurl'),\n array('http://longurl', 'https://sho.rt/yourls', '/yourls/http://longurl'),\n array('http://longurl?https://sho.rt/yourls', 'https://sho.rt/yourls', '/yourls/http://longurl?https://sho.rt/yourls'),\n array('http://sho.rt/somepage', 'http://sho.rt', '/http://sho.rt/somepage'),\n array('http://www.sho.rt/sub/dir/', 'http://www.sho.rt/sub/dir/', '/sub/dir///http://www.sho.rt/sub/dir/'),\n );\n }", "public function list(){\n\n $urls = Urls::all();\n \n $capturas = array();\n foreach($urls as $key=>$val){\n $status = $this->status_url($val['url']);\n $conteudo = $this->content_url($val['url']);\n /* bem simples. salva os dados no banco */\n $capturas[] = array('conteudo' => $conteudo, 'status' => $status, 'url_id' => $val['id']);\n }\n\n $this->salvar($capturas);\n }", "function getHttpResponseCode_using_getheaders($url, $followredirects = true){\n // NOTE: could potentially take up to 0-30 seconds , blocking further code execution (more or less depending on connection, target site, and local timeout settings))\n // if $followredirects == false: return the FIRST known httpcode (ignore redirects)\n // if $followredirects == true : return the LAST known httpcode (when redirected)\n if(! $url || ! is_string($url)){\n return false;\n }\n $headers = @get_headers($url);\n if($headers && is_array($headers)){\n if($followredirects){\n // we want the the last errorcode, reverse array so we start at the end:\n $headers = array_reverse($headers);\n }\n foreach($headers as $hline){\n // search for things like \"HTTP/1.1 200 OK\" , \"HTTP/1.0 200 OK\" , \"HTTP/1.1 301 PERMANENTLY MOVED\" , \"HTTP/1.1 400 Not Found\" , etc.\n // note that the exact syntax/version/output differs, so there is some string magic involved here\n if(preg_match('/^HTTP\\/\\S+\\s+([1-9][0-9][0-9])\\s+.*/', $hline, $matches) ){// \"HTTP/*** ### ***\"\n $code = $matches[1];\n return $code;\n }\n }\n // no HTTP/xxx found in headers:\n return false;\n }\n // no headers :\n return false;\n }", "function sdppi_url($year)\n\t{\n\t\tfor ($i=1; $i < 13; $i++)\n\t\t{ \n\t\t\tif ($i < 10)\n\t\t\t{\n\t\t\t\t$url = 'http://sdppi.kominfo.go.id/downloads/43/RHU-'.$year.'0'.$i.'.htm';\n\t\t\t\t$headers = get_headers($url);\n\t\t\t\t$status = substr($headers[0], 9, 3);\n\n\t\t\t\t//Memastikan link yang dihasilkan dapat diakses\n\t\t\t\tif ($status == '200')\n\t\t\t\t\t$result[$i-1] = $url;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$url = 'http://sdppi.kominfo.go.id/downloads/43/RHU-'.$year.$i.'.htm';\n\t\t\t\t$headers = get_headers($url);\n\t\t\t\t$status = substr($headers[0], 9, 3);\n\n\t\t\t\tif ($status == '200')\n\t\t\t\t\t$result[$i-1] = $url;\n\t\t\t}\n\t\t}\n\n\t\treturn array_values($result);\n\t}", "public function parseCode(string $code): array\n {\n $arrayImg = [];\n $regex = self::REGEX;\n preg_match_all($regex, $code, $arrayImg);\n $imageUrl = $arrayImg[1];\n\n return $imageUrl;\n }", "public function getUriList();", "function findPageUrls();", "public function getStatusCodes(): array\n {\n $rep = $this->em->getRepository(StatusCodes::class)->findAll();\n $arr = [];\n foreach ($rep as $item)\n {\n $arr[] = ['code' => $item->getScode(), 'title' => $item->getTitle()];\n }\n return $arr;\n }", "public function getUrls(string $html, string $parts='base.dir.file.ext.query') : array\n {\n if ($this->domainAcceptedCache->count() > $this->domainAcceptedCacheSize) {\n $this->domainAcceptedCache = $this->domainAcceptedCache\n ->slice(- $this->domainAcceptedCacheSize + $this->domainAcceptedCacheChunkSize);\n }\n return array_map(\n function ($url) {\n return (string) $url;\n },\n $this->filterExtensions(\n $this->filterDomains(\n $this->filterSchemes(\n $this->getAllUrls($html, $parts)\n )\n )\n )->toArray()\n );\n }", "public static function get_img_links($url) {\n // reset error and warnings;\n self::$error_msg = array();\n self::$warning_msg = array();\n self::$curl = curl_init();\n\n // check url\n if (!self::_url_is_valid($url)) {\n self::$error_msg[] = \"Invalid or empty URL Received, please try again.\";\n return array();\n }\n\n // url is valid, continue parsing\n $content = self::_fetch_url_content($url);\n $domain = self::_get_domain($url);\n $dom = self::_get_parsed_dom($content);\n\n $sanitized_img_links = self::_get_sanitized_img_links($dom, $domain);\n curl_close(self::$curl);\n\n return $sanitized_img_links;\n }", "public function providerRetriableCodes() {\n return array(\n array(Response::STATUS_CODE_429),\n array(Response::STATUS_CODE_503),\n array(Response::STATUS_CODE_504)\n );\n }" ]
[ "0.6547203", "0.6547203", "0.61781675", "0.6152183", "0.6105734", "0.6052675", "0.600427", "0.600287", "0.5984404", "0.5958778", "0.585329", "0.58336395", "0.5811", "0.5805932", "0.5791834", "0.5785595", "0.57458806", "0.5737714", "0.57219404", "0.5711406", "0.5698449", "0.56954277", "0.56746966", "0.5653655", "0.564077", "0.56044537", "0.5602478", "0.5574225", "0.5559524", "0.55504316" ]
0.6714659
0
/ 2.6 IMG ALT TAG ATTACHMENT /
function IMGalt_Attachment($attributes, $attachment){ // print_r($attributes); // print_r($attachment); // get up to date alt attribute $alt = SELF::getAltAttribute($attachment->ID); // set alt tag $attributes['alt'] = $alt; // output return $attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_image_send_to_editor($id, $caption, $title, $align, $url = '', $rel = \\false, $size = 'medium', $alt = '')\n {\n }", "function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-' . esc_attr($align) . '\">';\n\n \t\t$html_str .= \"<p><img src='$url' alt='$title' /></p>\";\n\n\t\tif($caption) $html_str .= '\n\t\t<p class=\"wp-caption-text\">' . $caption . '</p>\n\t\t';\n\n\t$html_str .= '</div>';\n\n return $html_str;\n}", "public function getImageTag();", "function IMGalt_Content($content) {\n if($content):\n // encode content\n $content = mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\n $document = new \\DOMDocument();\n // Disable libxml errors and allow user to fetch error information as needed\n libxml_use_internal_errors(true);\n $document->loadHTML(utf8_decode($content), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);\n // get img tag from content\n $images = $document->getElementsByTagName('img');\n foreach ($images as $image) {\n // get orginal from srcset\n if( $image->hasAttribute('srcset') ):\n $orginal = '';\n // get srcset from content and explode to array\n $srcset = $image->getAttribute('srcset');\n $srcset_array = explode(\", \", $srcset);\n // get orginal size\n foreach ($srcset_array as $key => $value) {\n $single_srcset = explode(\" \", $value);\n $src_size = str_replace(\"w\", \"\", end($single_srcset));\n if(strpos($single_srcset[0], $src_size) !== false):\n // not the orginal size\n // $orginal .= $single_srcset[0] . ' ' . $src_size;\n else:\n $orginal .= $single_srcset[0];\n endif;\n }\n else:\n $orginal = strpos($image->getAttribute('src'), 'http') !== false ? $image->getAttribute('src') : get_option( 'siteurl' ) . $image->getAttribute('src');\n endif;\n // get orginal img id and call alt\n $id = attachment_url_to_postid($orginal);\n $alt = SELF::getAltAttribute($id);\n $image->removeAttribute('alt');\n $image->setAttribute('alt', $alt);\n }\n // output\n return $document->saveHTML();\n endif;\n }", "function attachment_image_attributes_aload($attr) {\n\n if ( isset($attr['data-aload-on']) ) :\n\n $attr['data-aload'] = $attr['src'];\n $attr['src'] = 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';\n\n if ( $attr['srcset'] ) :\n $attr['data-aload-set'] = $attr['srcset'];\n $attr['srcset'] = 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';\n endif;\n endif;\n return $attr;\n}", "function cbv_get_image_alt( $url ){\n if( isset( $url ) ){\n $output = '';\n $id = attachment_url_to_postid($url);\n $image_title = get_the_title($id);\n $image_alt = get_post_meta( $id, '_wp_attachment_image_alt', true);\n if( empty( $image_alt ) ){\n $image_alt = $image_title;\n }\n $image_alt = str_replace('-', ' ', $image_alt);\n $output = $image_alt;\n\n return $output;\n }\n return false;\n}", "function acd_add_img_title( $attr, $attachment = null ) {\n\t$img_title = trim( strip_tags( $attachment->post_title ) );\n\t$img_title = str_replace(\"-\", \" \", $img_title); //remove hyphens\n\t$img_title = str_replace(\"_\", \" \", $img_title); //remove underscores\n\t$img_title = preg_replace('/[0-9]+/', '', $img_title); //remove numbers\n\t$img_title = ucwords($img_title); //capitalize first letter of each word\n\n\t$attr['title'] = $img_title; //add image title attribute\n\t// or get the title instead of image title $attr['title'] = the_title_attribute( 'echo=0' );\n\t$attr['alt'] = $img_title; //add alt attribute\n\treturn $attr;\n}", "function wp_get_attachment_link($post = 0, $size = 'thumbnail', $permalink = \\false, $icon = \\false, $text = \\false, $attr = '')\n {\n }", "function minorite_image($variables) {\n $attributes = $variables['attributes'];\n $attributes['src'] = file_create_url($variables['path']);\n\n foreach (array('alt', 'title') as $key) {\n\n if (isset($variables[$key])) {\n $attributes[$key] = $variables[$key];\n }\n }\n\n return '<img' . drupal_attributes($attributes) . ' />';\n}", "public function get_image_link()\n {\n }", "function cbv_get_image_tag( $id, $size = 'full', $title = false ){\n\tif( isset( $id ) ){\n\t\t$output = '';\n\t\t$image_title = get_the_title($id);\n\t\t$image_alt = get_post_meta( $id, '_wp_attachment_image_alt', true);\n if( empty( $image_alt ) ){\n $image_alt = $image_title;\n }\n\t\t$image_src = wp_get_attachment_image_src( $id, $size, false );\n\n\t\tif( $title ){\n\t\t\t$output = '<img src=\"'.$image_src[0].'\" alt=\"'.$image_alt.'\" title=\"'.$image_title.'\">';\n\t\t}else{\n\t\t\t$output = '<img src=\"'.$image_src[0].'\" alt=\"'.$image_alt.'\">';\n\t\t}\n\n\t\treturn $output;\n\t}\n\treturn false;\n}", "function newsletter_image($ref, $size){\r\n\t\r\n\t$default_attr = array(\r\n\t\t'class'\t=> \"attachment-$size\",\r\n\t\t'alt' => trim(strip_tags( get_post_meta($ref, '_wp_attachment_image_alt', true) ))\r\n\t);\r\n\t\r\n\t$retour->image\t\t= wp_get_attachment_image( $ref, $size , false, $default_attr);\r\n\t$retour->legende\t= '<p style=\"font-family:Tahoma, Arial, sans-serif;color:#666666;font-size:11px;margin:7px 0;padding:0;font-style:italic;\">' . get_post_meta($ref, '_wp_attachment_image_alt', true) . '</p>';\r\n\t\r\n\treturn $retour;\r\n}", "function image($img,$attribute = array()){\r\n\t\t$tmp = '';\r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\r\n\t\t$default = ''; $width = 0;\r\n\t\t$folder = ''; $height = 0;\r\n\r\n\t\t$att = array();\r\n\t\tif(isset($attribute['default'])){\r\n\t\t\t$att['default'] = $attribute['default'];\r\n\t\t\tunset($attribute['default']);\r\n\t\t}\r\n\t\tif(isset($attribute['folder'])){\r\n\t\t\t$att['folder'] = $attribute['folder'];\r\n\t\t\tunset($attribute['folder']);\r\n\t\t}\r\n\t\tif(isset($attribute['fixed'])){\r\n\t\t\t$att['fixed'] = $attribute['fixed'];\r\n\t\t\tunset($attribute['fixed']);\r\n\t\t}\r\n\t\tif(isset($attribute['absolute'])){\r\n\t\t\t$att['absolute'] = $attribute['absolute'];\r\n\t\t\tunset($attribute['absolute']);\r\n\t\t}\r\n\t\tif(isset($attribute['fullpath'])){\r\n\t\t\t$att['fullpath'] = $attribute['fullpath'];\r\n\t\t\tunset($attribute['fullpath']);\r\n\t\t}else{\r\n\t\t\t$att['fullpath'] = 'true';\r\n\t\t}\r\n\r\n\t\tBASIC::init()->imported('media.mod');\r\n\t\t$media = new BASIC_MEDIA($img, $att);\r\n\r\n\t\tif(isset($attribute['width'])) $width = $attribute['width'];\r\n\t\tif(isset($attribute['height'])) $height = $attribute['height'];\r\n\r\n\t\tif($media->info['type'] == 13 || $media->info['type'] == 4){\r\n\t\t\t$this->headSpecial('<!--[if IE]><script type=\"text/javascript\" src=\"'.BASIC::init()->ini_get('root_virtual').BASIC::init()->ini_get('basic_path').'scripts/flash/flash.js\" defer=\"defer\"></script><![endif]-->','Flash');\r\n\t\t}\r\n\t\treturn $media->view($width,$height,$attribute) . $tmp;\r\n\t}", "function getSrcAltImage($postID,$size=false){\n\t$imgID = get_post_thumbnail_id($postID);\n\t$img = wp_get_attachment_image_src($imgID,$size, false, '');\n\t$imgAlt = get_post_meta($imgID,'_wp_attachment_image_alt', true);\n\t$imgAttr = array(\n\t\t'url' => $img,\n\t\t'alt' => $imgAlt\n\t);\n\tif(is_shop()){\n\t\techo '<section class=\"shop-image\">';\n\t\techo '<img class=\"img-max\" src=\"' . $imgAttr['url'][0] . '\" alt=\"\" />';\n\t\techo '</section>';\n\t}else{\n\t\treturn $imgAttr;\n\t}\n}", "function image_add_caption($html, $id, $caption, $title, $align, $url, $size, $alt = '')\n {\n }", "public static function img($img, $alt, $title = '') {\r\n\t\t\t$file = WEB_ROOT . '/' . $img;\r\n\t\t\tif(!file_exists($file)) {\r\n\t\t\t\tABPF::logger()->error(\"Image file $file doesn't exist!\");\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t\t$v = filemtime($file);\r\n\t\t\treturn sprintf('<img src=\"%s/%s?v=%d\" alt=\"%s\" title=\"%s\" />', BASE_URL, $img, $v, $alt, $title);\r\n\t\t}", "function dizzy_featured_ogimg () { \n\t $thumb = get_the_post_thumbnail($post->ID);\n\t\t$pattern= \"/(?<=src=['|\\\"])[^'|\\\"]*?(?=['|\\\"])/i\";\n\t\tpreg_match($pattern, $thumb, $thePath);\n\t\t$theSrc = $thePath[0];\n}", "protected function getImageAttributes() {}", "function get_attachment_icon_src($id = 0, $fullsize = \\false)\n {\n }", "function getName() \t\t { return 'NP_ImageCreateThumbnail'; }", "function iti_get_image_alt_from_url( $url = '' ) {\n\tglobal $wpdb;\n\n\t$url = esc_url( $url );\n\n\t/** @noinspection PhpUndefinedMethodInspection */\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $url ) );\n\n\t$post_id = isset( $attachment[0] ) ? $attachment[0] : 0;\n\t$alt = get_post_meta( absint( $post_id ), '_wp_attachment_image_alt', true );\n\n\treturn $alt;\n}", "function wp_img_tag_add_srcset_and_sizes_attr($image, $context, $attachment_id)\n {\n }", "function column_alt_text( $item ) {\r\n\t\tif ( isset( $item->mla_wp_attachment_image_alt ) ) {\r\n\t\t\tif ( is_array( $item->mla_wp_attachment_image_alt ) ) {\r\n\t\t\t\t$alt_text = $item->mla_wp_attachment_image_alt[0];\r\n\t\t\t} else {\r\n\t\t\t\t$alt_text = $item->mla_wp_attachment_image_alt;\r\n\t\t\t}\r\n\r\n\t\t\treturn sprintf( '<a href=\"%1$s\" title=\"' . __( 'Filter by', 'media-library-assistant' ) . ' &#8220;%2$s&#8221;\">%3$s</a>', esc_url( add_query_arg( array_merge( array(\r\n\t\t\t\t'page' => MLACore::ADMIN_PAGE_SLUG,\r\n\t\t\t\t'mla-metakey' => '_wp_attachment_image_alt',\r\n\t\t\t\t'mla-metavalue' => urlencode( $alt_text ),\r\n\t\t\t\t'heading_suffix' => urlencode( __( 'ALT Text', 'media-library-assistant' ) . ': ' . $alt_text ) \r\n\t\t\t), self::mla_submenu_arguments( false ) ), 'upload.php' ) ), esc_html( $alt_text ), esc_html( $alt_text ) );\r\n\t\t}\r\n\r\n\t\treturn '';\r\n\t}", "function swap_image($msg){\n\n\tif(preg_match(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",$msg)){\n\t\t$msg=preg_replace(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",\"$2\",$msg);\n\t}\n\nreturn $msg;\n}", "function essence_attachment_link( $link, $id ) {\n\tif ( is_feed() || is_admin() )\n\t\treturn $link;\n\n\t$post = get_post( $id );\n\n\tif ( 'image' == substr( $post->post_mime_type, 0, 5 ) )\n\t\treturn wp_get_attachment_url( $id );\n\telse\n\t\treturn $link;\n}", "function cws_get_alt_text( $image_url ) {\n\tglobal $wpdb;\n\n\tif( ! isset( $image_url ) ) {\n\t\techo \"Please add an image.\";\n\t\treturn;\n\t}\n\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url ) );\n\t$alt_text = get_post_meta( $attachment[0], '_wp_attachment_image_alt', true );\n\t$alt_default = 'CWS default alt tag';\n\n\tif( ! empty( $alt_text ) ) {\n\t\treturn $alt_text;\n\t} else {\n\t\treturn $alt_default;\n\t}\n}", "function get_attachment_link($post = \\null, $leavename = \\false)\n {\n }", "function img( $src = '', $index_page = FALSE, $attributes = '' )\n\t{\n\t\tif ( ! is_array( $src ) )\n\t\t{\n\t\t\t$src = [ 'src' => $src ];\n\t\t}\n\n\t\t// If there is no alt attribute defined, set it to an empty string\n\t\tif ( ! isset( $src[ 'alt' ] ) )\n\t\t{\n\t\t\t$src[ 'alt' ] = '';\n\t\t}\n\n\t\t$img = '<img';\n\n\t\tforeach ( $src as $k => $v )\n\t\t{\n\t\t\tif ( $k === 'src' && ! preg_match( '#^([a-z]+:)?//#i', $v ) )\n\t\t\t{\n\t\t\t\tif ( $index_page === TRUE )\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . get_instance()->config->site_url( $v ) . '\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . \\O2System::$config->slash_item( 'base_url' ) . $v . '\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img .= ' ' . $k . '=\"' . $v . '\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $img . _stringify_attributes( $attributes ) . ' />';\n\t}", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "function bethel_filter_image_attributes_for_gallery ($attr, $attachment) {\n $attr ['id'] = \"gallery-image-id-{$attachment->ID}\";\n $attr ['class'] .= ' gallery-thumbnail';\n return $attr;\n}" ]
[ "0.6808126", "0.63869506", "0.6359961", "0.63204473", "0.6179372", "0.6098405", "0.60709876", "0.60480756", "0.60252535", "0.6022915", "0.6002773", "0.59758204", "0.58942604", "0.5855631", "0.58382475", "0.58003324", "0.5790051", "0.57877487", "0.5761844", "0.57565975", "0.57403344", "0.57317847", "0.57304716", "0.57120067", "0.5692528", "0.5683302", "0.5678282", "0.5676166", "0.56652063", "0.5653678" ]
0.7443384
0
/================================================================================== 3.0 OUTPUT ================================================================================== / 3.1 IMG ALT TAG CONTENT /
function IMGalt_Content($content) { if($content): // encode content $content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8"); $document = new \DOMDocument(); // Disable libxml errors and allow user to fetch error information as needed libxml_use_internal_errors(true); $document->loadHTML(utf8_decode($content), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); // get img tag from content $images = $document->getElementsByTagName('img'); foreach ($images as $image) { // get orginal from srcset if( $image->hasAttribute('srcset') ): $orginal = ''; // get srcset from content and explode to array $srcset = $image->getAttribute('srcset'); $srcset_array = explode(", ", $srcset); // get orginal size foreach ($srcset_array as $key => $value) { $single_srcset = explode(" ", $value); $src_size = str_replace("w", "", end($single_srcset)); if(strpos($single_srcset[0], $src_size) !== false): // not the orginal size // $orginal .= $single_srcset[0] . ' ' . $src_size; else: $orginal .= $single_srcset[0]; endif; } else: $orginal = strpos($image->getAttribute('src'), 'http') !== false ? $image->getAttribute('src') : get_option( 'siteurl' ) . $image->getAttribute('src'); endif; // get orginal img id and call alt $id = attachment_url_to_postid($orginal); $alt = SELF::getAltAttribute($id); $image->removeAttribute('alt'); $image->setAttribute('alt', $alt); } // output return $document->saveHTML(); endif; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IMGalt_Attachment($attributes, $attachment){\n // print_r($attributes);\n // print_r($attachment);\n // get up to date alt attribute\n $alt = SELF::getAltAttribute($attachment->ID);\n // set alt tag\n $attributes['alt'] = $alt;\n // output\n return $attributes;\n }", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "private function getImg()\n\t{\n\t\t$buffer = '&nbsp;';\n\t\t\n\t\tif(!$this->aImg['sFilename'])\n\t\t\treturn $buffer;\n\t\t\n\t\t$buffer = '<img src=\"../../thumbs/'.$this->aImg['sFilename'].'\" />';\t\t\n\t\t\n\t\treturn $buffer;\n\t}", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "function replaceIMG($html)\r\n\t{\r\n\t\t$iStart = stripos($html,\"<img\");\r\n\t\twhile((string)$iStart != null) //string typecast to handle \"0\" which equates to FALSE in PHP...\r\n\t\t{\r\n\t\t\t//get entire IMG tag\r\n\t\t\t$iEnd = stripos($html,\">\",$iStart)+1;\r\n\t\t\t$imgTag = substr($html,$iStart,($iEnd-$iStart));\r\n\t\t\t\r\n\t\t\t//get src\r\n\t\t\t$iSrcStart = stripos($imgTag,\"src=\");\r\n\t\t\tif(substr($imgTag,($iSrcStart+4),1) == \"'\")\r\n\t\t\t{\r\n\t\t\t\t//single quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,\"'\",$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//double quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,'\"',$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\t$imgSrc = substr($imgTag,$iSrcStart+5,($iSrcEnd-($iSrcStart+5)));\r\n\t\t\t\r\n\t\t\t//get alt\r\n\t\t\t$iAltStart = stripos($imgTag,\"alt=\");\r\n\t\t\tif($iAltStart != null)\r\n\t\t\t{\r\n\t\t\t\tif(substr($imgTag,($iAltStart+4),1) == \"'\")\r\n\t\t\t\t{\r\n\t\t\t\t\t//single quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,\"'\",$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t//double quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,'\"',$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\t$imgAlt = substr($imgTag,$iAltStart+5,($iAltEnd-($iAltStart+5)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//replace HTML\r\n\t\t\tif((string)stripos($imgSrc,\"scripts/CLEditor/images/icons/\") == null) //exclude icons from rich text editor\r\n\t\t\t{\r\n\t\t\t\t$replacementHTML = \"<div class='table comicborder popupshadow-margin'><div class='table-row'><div class='table-cell'><a href='\" . $imgSrc . \"'>\" . $imgTag . \"</a></div></div>\";\r\n\t\t\t\tif($iAltStart != null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$replacementHTML = $replacementHTML . \"<div class='table-row'><div class='table-cell comicimagecaption'>\" . $imgAlt . \"</div></div>\";\r\n\t\t\t\t}\r\n\t\t\t\t$replacementHTML = $replacementHTML . \"</div>\";\r\n\t\t\t\t$html = substr_replace($html,$replacementHTML,$iStart,($iEnd-$iStart));\r\n\t\t\t\t\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($replacementHTML)));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($imgTag)));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $html;\r\n\t}", "public function getImageTag();", "function cbv_get_image_alt( $url ){\n if( isset( $url ) ){\n $output = '';\n $id = attachment_url_to_postid($url);\n $image_title = get_the_title($id);\n $image_alt = get_post_meta( $id, '_wp_attachment_image_alt', true);\n if( empty( $image_alt ) ){\n $image_alt = $image_title;\n }\n $image_alt = str_replace('-', ' ', $image_alt);\n $output = $image_alt;\n\n return $output;\n }\n return false;\n}", "function minorite_image($variables) {\n $attributes = $variables['attributes'];\n $attributes['src'] = file_create_url($variables['path']);\n\n foreach (array('alt', 'title') as $key) {\n\n if (isset($variables[$key])) {\n $attributes[$key] = $variables[$key];\n }\n }\n\n return '<img' . drupal_attributes($attributes) . ' />';\n}", "function get_image_send_to_editor($id, $caption, $title, $align, $url = '', $rel = \\false, $size = 'medium', $alt = '')\n {\n }", "function IMG($img, $extra = '')\n{\n /**\n * An Image tag.\n *\n * Args:\n * $img (str): the image source\n * $extra (str): extra data in the tag - used for adding class / ID etc.\n */\n echo \"<img src='\" . $img . \"'\" ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' ;\n}", "function initialize () {\n $this->set_openingtag ( \"<IMG alt=\\\"\" );\n\t $this->set_closingtag ( \"\\\"[attributes]/>\" );\n }", "public function createImgTag() {\n\t\t$this->imgNeko = '<img src=\"';\n\t\t$this->imgNeko .= $this->imgUri;\n\t\t$this->imgNeko .= '\" width=\"';\n\t\t$this->imgNeko .= $this->imgSize[0];\n\t\t$this->imgNeko .= '\" height=\"';\n\t\t$this->imgNeko .= $this->imgSize[1];\n\t\t$this->imgNeko .= '\" alt=\"';\n\t\t$this->imgNeko .= $this->creditInfo;\n\t\t$this->imgNeko .= '\">';\n\t}", "function img( $src = '', $index_page = FALSE, $attributes = '' )\n\t{\n\t\tif ( ! is_array( $src ) )\n\t\t{\n\t\t\t$src = [ 'src' => $src ];\n\t\t}\n\n\t\t// If there is no alt attribute defined, set it to an empty string\n\t\tif ( ! isset( $src[ 'alt' ] ) )\n\t\t{\n\t\t\t$src[ 'alt' ] = '';\n\t\t}\n\n\t\t$img = '<img';\n\n\t\tforeach ( $src as $k => $v )\n\t\t{\n\t\t\tif ( $k === 'src' && ! preg_match( '#^([a-z]+:)?//#i', $v ) )\n\t\t\t{\n\t\t\t\tif ( $index_page === TRUE )\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . get_instance()->config->site_url( $v ) . '\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . \\O2System::$config->slash_item( 'base_url' ) . $v . '\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img .= ' ' . $k . '=\"' . $v . '\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $img . _stringify_attributes( $attributes ) . ' />';\n\t}", "function cbv_get_image_tag( $id, $size = 'full', $title = false ){\n\tif( isset( $id ) ){\n\t\t$output = '';\n\t\t$image_title = get_the_title($id);\n\t\t$image_alt = get_post_meta( $id, '_wp_attachment_image_alt', true);\n if( empty( $image_alt ) ){\n $image_alt = $image_title;\n }\n\t\t$image_src = wp_get_attachment_image_src( $id, $size, false );\n\n\t\tif( $title ){\n\t\t\t$output = '<img src=\"'.$image_src[0].'\" alt=\"'.$image_alt.'\" title=\"'.$image_title.'\">';\n\t\t}else{\n\t\t\t$output = '<img src=\"'.$image_src[0].'\" alt=\"'.$image_alt.'\">';\n\t\t}\n\n\t\treturn $output;\n\t}\n\treturn false;\n}", "function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-' . esc_attr($align) . '\">';\n\n \t\t$html_str .= \"<p><img src='$url' alt='$title' /></p>\";\n\n\t\tif($caption) $html_str .= '\n\t\t<p class=\"wp-caption-text\">' . $caption . '</p>\n\t\t';\n\n\t$html_str .= '</div>';\n\n return $html_str;\n}", "function cws_get_alt_text( $image_url ) {\n\tglobal $wpdb;\n\n\tif( ! isset( $image_url ) ) {\n\t\techo \"Please add an image.\";\n\t\treturn;\n\t}\n\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url ) );\n\t$alt_text = get_post_meta( $attachment[0], '_wp_attachment_image_alt', true );\n\t$alt_default = 'CWS default alt tag';\n\n\tif( ! empty( $alt_text ) ) {\n\t\treturn $alt_text;\n\t} else {\n\t\treturn $alt_default;\n\t}\n}", "protected function _build() {\n $alt_title = $this->isXhtml ? tep_output_string_protected( str_replace ( '&amp;', '&', $this->attributes['alt'] ) ) : tep_output_string( $this->attributes['alt'] );\n $parameters = tep_not_null( $this->parameters ) ? tep_output_string( $this->parameters ) : false;\n $width = (int)$this->_calculated_width;\n $height = (int)$this->_calculated_height;\n $this->_html = '<img width=\"' . $width . '\" height=\"' . $height . '\" src=\"' . $this->src . '\" title=\"' . $alt_title . '\" alt=\"' . $alt_title . '\"';\n if ( false !== $parameters ) $this->_html .= ' ' . html_entity_decode(tep_output_string( $parameters ));\n $this->_html .= $this->isXhtml ? ' />' : '>'; \n }", "public function img($src = \"\", $alt = \"\") {\n echo \"<img src=assets/img/'\" . $src . \"' alt='\" . $alt . \"'>\";\n }", "function lazy_imgs($html, $id, $caption, $title, $align, $url, $size, $alt) {\n\n $imgNew = '<img data-original=\"' . $url . '\" ';\n $html = str_replace('<img ', $imgNew, $html);\n return $html;\n}", "function getSrcAltImage($postID,$size=false){\n\t$imgID = get_post_thumbnail_id($postID);\n\t$img = wp_get_attachment_image_src($imgID,$size, false, '');\n\t$imgAlt = get_post_meta($imgID,'_wp_attachment_image_alt', true);\n\t$imgAttr = array(\n\t\t'url' => $img,\n\t\t'alt' => $imgAlt\n\t);\n\tif(is_shop()){\n\t\techo '<section class=\"shop-image\">';\n\t\techo '<img class=\"img-max\" src=\"' . $imgAttr['url'][0] . '\" alt=\"\" />';\n\t\techo '</section>';\n\t}else{\n\t\treturn $imgAttr;\n\t}\n}", "function img($src = '', $attributes = '', $index_page = false)\n\t{\n\t\tif ( ! is_array($src) )\n\t\t{\n\t\t\t$src = array('src' => $src);\n\t\t}\n\n\t\t// If there is no alt attribute defined, set it to an empty string\n\t\tif ( ! isset($src['alt']))\n\t\t{\n\t\t\t$src['alt'] = '';\n\t\t}\n\n\t\t$img = '<img';\n\n\t\tforeach ($src as $k => $v)\n\t\t{\n\t\t\tif ($k === 'src' && ! preg_match('#^(data:[a-z,;])|(([a-z]+:)?(?<!data:)//)#i', $v))\n\t\t\t{\n\t\t\t\tif ($index_page === true)\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"'.get_instance()->config->site_url($v).'\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"'.get_instance()->config->slash_item('base_url').$v.'\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img .= ' '.$k.'=\"'.$v.'\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $img._stringify_attributes($attributes).' />';\n\t}", "function jcr_image_custom($atts)\n {\n global $thisimage;\n\n assert_image();\n\n extract(lAtts(array(\n 'escape' => 'html',\n ), $atts));\n\n return ($escape == 'html')\n ? txpspecialchars($thisimage['jcr_image_custom'])\n : $thisimage['jcr_image_custom'];\n }", "public function render(){\n\t\t$out = \"<img\".($this->getID() ? \" id=\\\"\".$this->getID().\"\\\"\" : \"\");\n\t\t\n\t\t$out .= \" src=\\\"\".$this->link.\"\\\"\";\n\t\t\n\t\tforeach( $this->getProperties() as $key => $value ) {\n\t\t\t$out .= \" \".$key.\"=\\\"\".$value.\"\\\"\"; //example: _width=\"100px\"\n\t\t}\n\t\t$out .= \" />\"; //end of opening html tag and html properties\n\t\t\n\t\treturn $out;\n\t}", "public static function img($img, $alt, $title = '') {\r\n\t\t\t$file = WEB_ROOT . '/' . $img;\r\n\t\t\tif(!file_exists($file)) {\r\n\t\t\t\tABPF::logger()->error(\"Image file $file doesn't exist!\");\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t\t$v = filemtime($file);\r\n\t\t\treturn sprintf('<img src=\"%s/%s?v=%d\" alt=\"%s\" title=\"%s\" />', BASE_URL, $img, $v, $alt, $title);\r\n\t\t}", "function column_alt_text( $item ) {\r\n\t\tif ( isset( $item->mla_wp_attachment_image_alt ) ) {\r\n\t\t\tif ( is_array( $item->mla_wp_attachment_image_alt ) ) {\r\n\t\t\t\t$alt_text = $item->mla_wp_attachment_image_alt[0];\r\n\t\t\t} else {\r\n\t\t\t\t$alt_text = $item->mla_wp_attachment_image_alt;\r\n\t\t\t}\r\n\r\n\t\t\treturn sprintf( '<a href=\"%1$s\" title=\"' . __( 'Filter by', 'media-library-assistant' ) . ' &#8220;%2$s&#8221;\">%3$s</a>', esc_url( add_query_arg( array_merge( array(\r\n\t\t\t\t'page' => MLACore::ADMIN_PAGE_SLUG,\r\n\t\t\t\t'mla-metakey' => '_wp_attachment_image_alt',\r\n\t\t\t\t'mla-metavalue' => urlencode( $alt_text ),\r\n\t\t\t\t'heading_suffix' => urlencode( __( 'ALT Text', 'media-library-assistant' ) . ': ' . $alt_text ) \r\n\t\t\t), self::mla_submenu_arguments( false ) ), 'upload.php' ) ), esc_html( $alt_text ), esc_html( $alt_text ) );\r\n\t\t}\r\n\r\n\t\treturn '';\r\n\t}", "public function getAlt(): string\n {\n return htmlspecialchars($this->getDescription(), ENT_QUOTES);\n }", "public static function getAltAttribute(int $id = 0){\n // vars\n $output = '';\n $lang = prefix_core_BaseFunctions::getCurrentLang();\n // check if active lang is default or not\n if($lang == SELF::$WPimgAttr_Alt_languages[0]):\n // default language\n $output .= get_post_meta($id, '_wp_attachment_image_alt', TRUE);\n else:\n // alternative text\n $name = SELF::$WPimgAttr_Alt_prefix . $lang;\n $output .= get_post_meta($id, $name, true);\n endif;\n // output\n return $output;\n }", "public function alt(){\n\t\tif( $this->alt ) {\n\t\t\treturn $this->alt;\n\t\t}//end if\n\n\t\t$this->alt = @file_get_contents( $this->base_dir.'/'.$this->dir . $this->filename . '.alt');\n\n\t\treturn $this->alt;\n\t}", "function swap_image($msg){\n\n\tif(preg_match(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",$msg)){\n\t\t$msg=preg_replace(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",\"$2\",$msg);\n\t}\n\nreturn $msg;\n}", "function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }" ]
[ "0.7009078", "0.68325895", "0.6692804", "0.66500384", "0.66121835", "0.65053207", "0.6485219", "0.6444968", "0.64215714", "0.6418329", "0.63981396", "0.6385716", "0.6361115", "0.63594073", "0.6359043", "0.6341475", "0.6329196", "0.6321962", "0.631671", "0.6298811", "0.6281806", "0.6281429", "0.6267405", "0.62612134", "0.62391883", "0.62328833", "0.623108", "0.6224123", "0.62189394", "0.6199195" ]
0.7602596
0
Get iterator object of body row elements
public function getIterator() { return new ArrayIterator($this->_tbody->getElements()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIterator()\n {\n return new ArrayObject($this->_rows);\n }", "public function getIterator()\n {\n return new Itr($this);\n }", "public function getIterator() {}", "public function getIterator() {}", "function getInnerIterator()\n\t{\n\t\treturn $this->iterator;\n\t}", "function getElements() {\n return $this->rows_object;\n }", "public function getIterator()\n {\n return new \\ArrayIterator([$this->contents]);\n }", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator() {\n\t\t// Load related records for current row\n\t\t$data = $this->execute();\n\t\treturn $data ? $data : array();\n\t}", "function getIterator() {\r\n\t\treturn new \\ArrayIterator($this->data);\r\n\t}", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->fetch());\n\t}", "abstract public function getIterator();", "function getiterator() {\n\t\treturn new \\ArrayIterator($this->cast());\n\t}", "public function iterator();", "public function iterator()\n {\n return $this->getIterator();\n }", "public function getIterator(): Iterator {}", "public function getIterator()\r\n {\r\n return $this->all();\r\n }", "public function getIterator()\n {\n return $this->iterator();\n }", "public function getIterator()\n {\n return $this->multi()->load();\n }", "public function getIterator() {\n\t\treturn new \\ArrayObject($this->data);\n\t}", "public function getIterator(): \\Iterator\n {\n return new \\ArrayIterator($this->headers);\n }", "public function getIterator()\n {\n return $this->getValue();\n }", "public function getIterator() {\n return new \\ArrayIterator($this->getValues());\n }", "public function getItemIterator()\n {\n return new ArrayIterator($this->data->items);\n }", "public function getIterator()\n {\n return $this->headers->getIterator();\n }" ]
[ "0.695523", "0.68069005", "0.6612693", "0.6612693", "0.65917534", "0.6573931", "0.65696836", "0.65684927", "0.65684927", "0.65684927", "0.65684927", "0.65684927", "0.65684927", "0.6512575", "0.65009004", "0.6494172", "0.6463965", "0.6391734", "0.6346755", "0.63464385", "0.63425547", "0.6318436", "0.63140905", "0.62703806", "0.62690115", "0.62667733", "0.6247886", "0.62472266", "0.6238347", "0.6223869" ]
0.73687
0

No dataset card yet

Downloads last month
4