Code Snippet: Revert all overridden views
<span style="color: #000000"><span style="color: #0000BB"><?php<br>$views </span><span style="color: #007700">= </span><span style="color: #0000BB">views_get_all_views</span><span style="color: #007700">();<br> <br>foreach (</span><span style="color: #0000BB">$views </span><span style="color: #007700">as </span><span style="color: #0000BB">$view</span><span style="color: #007700">) {<br> if (</span><span style="color: #0000BB">$view</span><span style="color: #007700">-></span><span style="color: #0000BB">disabled</span><span style="color: #007700">) continue;<br> <br> if (</span><span style="color: #0000BB">$view</span><span style="color: #007700">-></span><span style="color: #0000BB">type </span><span style="color: #007700">== </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Overridden'</span><span style="color: #007700">)) {<br> </span><span style="color: #0000BB">$view</span><span style="color: #007700">-></span><span style="color: #0000BB">delete</span><span style="color: #007700">();<br> </span><span style="color: #0000BB">views_object_cache_clear</span><span style="color: #007700">(</span><span style="color: #DD0000">'view'</span><span style="color: #007700">, </span><span style="color: #0000BB">$view</span><span style="color: #007700">-></span><span style="color: #0000BB">name</span><span style="color: #007700">);<br> }<br>}<br></span><span style="color: #0000BB">?></span></span>
Tags: