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 ... | [
"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.7104... | 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_... | [
"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.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 ... | [
"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.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 ... | [
"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.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'... | [
"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.... | 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 ... | [
"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.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_FUL... | [
"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.5841394... | 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 ... | [
"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.6... | 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 unregist... | [
"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.72... | 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', 'dashboar... | [
"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.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... | [
"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.581... | 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 r... | [
"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.6... | 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 getDay... | [
"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.712... | 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->getReq... | [
"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.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(): Mid... | [
"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.5668... | 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(ServerRequestInter... | [
"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.4921403... | 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 ... | [
"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.6... | 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,... | [
"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.519... | 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... | [
"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.... | 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-... | [
"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.57... | 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 ... | [
"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.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;\... | [
"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.634... | 0.73687 | 0 |
End of preview. Expand
in Data Studio
No dataset card yet
- Downloads last month
- 11